[TIMOB-14664] BlackBerry: Ti.Utils object is undefined so using it causes a crash.
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2013-09-19T20:56:02.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 3.2.0 |
| Components | BlackBerry |
| Labels | documentation, qe-testadded |
| Reporter | Russell McMahon |
| Assignee | Pedro Enrique |
| Created | 2013-07-26T03:28:59.000+0000 |
| Updated | 2014-02-19T23:28:08.000+0000 |
Description
Test
var key = Ti.Utils.sha1(String/Titanium.Blob obj);
console.log(key);
Currently the Ti.Utils is not exposed externally. We have scheduled it for the 3.2 release. If your using Ti.Utils please wrap it in a platform conditional. If wrapping the Ti.Utils call causes problems please note what your app is doing and we will see about upping the priority of the fix higher.
Test code
PR: https://github.com/appcelerator/titanium_mobile_blackberry/pull/176var win = Ti.UI.createWindow({ layout: 'vertical' }); function Button(_title, _callback) { var btn = Ti.UI.createButton({ title: _title, top: 10 }); btn.addEventListener('click', _callback); return btn } win.add(Button('base64encode', base64encode)); win.add(Button('base64decode', base64decode)); win.add(Button('md5', md5)); win.add(Button('sha1', sha1)); win.add(Button('sha256', sha256)); win.open(); function base64encode() { var result = Ti.Utils.base64encode('Titanium Rocks!').text; Ti.API.info('base64encode'); Ti.API.info(result); } function base64decode() { var result = Ti.Utils.base64decode('VGl0YW5pdW0gUm9ja3Mh').text; Ti.API.info('base64decode'); Ti.API.info(result); } function md5() { var result = Ti.Utils.md5HexDigest('Titanium Rocks!'); Ti.API.info('md5'); Ti.API.info(result); } function sha1() { var result = Ti.Utils.sha1('Titanium Rocks!'); Ti.API.info('sha1'); Ti.API.info(result); } function sha256() { var result = Ti.Utils.sha256('Titanium Rocks!'); Ti.API.info('sha256'); Ti.API.info(result); }Verified with Environment: Appcelerator Studio: 3.2.0.201311122045 SDK:3.2.0.v20131112180422 alloy: 1.3.0 acs: 1.0.7 npm: 1.3.2 titanium: 3.2.0 titanium-code-processor: 1.0.3 Xcode:5.0.1 Device: Blackeberry Z 10 OS: Mac OSX 10.9 BB OS 10.0.10.261 Above mentioned code used for testing. Ti.Utils working fine. Hence closing as working well and verified.