{ "id": "151935", "key": "TIMOB-19709", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "14826", "description": "Release 5.1.0-remaining iOS9 features, Android M features", "name": "Release 5.1.0", "archived": false, "released": true, "releaseDate": "2015-11-20" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-10-13T20:58:47.000+0000", "created": "2015-10-11T15:44:02.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [ { "id": "14826", "description": "Release 5.1.0-remaining iOS9 features, Android M features", "name": "Release 5.1.0", "archived": false, "released": true, "releaseDate": "2015-11-20" } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2015-10-21T22:07:05.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "When you use a custom image for {{Ti.UI.iOS.ApplicationShortcuts.addDynamicShortcut()}} it won't work because the [source code|https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiUIiOSApplicationShortcutsProxy.m#L182] doesn't [hash the passed image path|https://github.com/appcelerator/titanium_mobile/pull/7248/files] so it work with now we're generate asset catalogs for images with TIMOB-19296.\r\n\r\n{code:javascript}\r\n\tappShortcuts.addDynamicShortcut({\r\n\t\titemtype: 'my.type',\r\n\t\ttitle: 'My title',\r\n\t\tsubtitle: 'My subtitle',\r\n\r\n\t\t// does not work:\r\n\t\t// icon: '/images/shortcutItemIcon.png',\r\n\r\n\t\t// does work\r\n\t\ticon: '6ce9fb071294c440a20ff73b7c09fef2082c2206',\r\n\t});\r\n{code}", "attachment": [], "flagged": false, "summary": "Ti.UI.iOS.ApplicationShortcuts.addDynamicShortcut icon does not work with custom images", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "SDK 5.1.0.v20151009094506", "comment": { "comments": [ { "id": "366604", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "With PR and https://github.com/appcelerator-developer-relations/appc-sample-3dtouch still doesn't work and seems to be an error in the new code:\r\n\r\n{code}\r\n-(NSString*)urlInAssetCatalog:(NSString*)url\r\n{\r\n NSString *resultUrl = nil;\r\n\r\n NSLog(@\"[ERROR] In urlInAssetCatalog\");\r\n \r\n unsigned char digest[CC_SHA1_DIGEST_LENGTH];\r\n NSData *stringBytes = [url dataUsingEncoding: NSUTF8StringEncoding];\r\n if (CC_SHA1([stringBytes bytes], (CC_LONG)[stringBytes length], digest)) {\r\n\r\n NSLog(@\"[ERROR] In urlInAssetCatalog IF\");\r\n\r\n // SHA-1 hash has been calculated and stored in 'digest'.\r\n NSMutableString *sha = [[NSMutableString alloc] init];\r\n for (int i = 0; i < CC_SHA1_DIGEST_LENGTH; i++) {\r\n [sha appendFormat:@\"%02x\", digest[i]];\r\n }\r\n [sha appendString:@\".\"];\r\n [sha appendString:[url pathExtension]];\r\n\r\n NSLog(@\"[ERROR] resultUrl %@ wow\", sha);\r\n \r\n resultUrl = sha;\r\n RELEASE_TO_NIL(sha)\r\n }\r\n\r\n NSLog(@\"[ERROR] resultUrl %@ wow\", resultUrl);\r\n \r\n return resultUrl;\r\n}\r\n{code}\r\n\r\ngives:\r\n\r\n{code}\r\n[ERROR] In urlInAssetCatalog\r\n[ERROR] In urlInAssetCatalog IF\r\n[ERROR] resultUrl 6ce9fb071294c440a20ff73b7c09fef2082c2206.png wow\r\n[ERROR] resultUrl [ERROR] resultUrl wow\r\n{code}\r\n\r\nso I guess {{resultUrl}} needs to be a proper copy of {{sha}} or {{sha}} should not be nilled.\r\n\r\nIf I remove the {{RELEASE_TO_NIL}} line or replace the preceding reference with the following copy it works:\r\n\r\n{code}\r\nresultUrl = [NSMutableString stringWithString: sha];\r\n{code}", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-10-13T07:16:43.000+0000", "updated": "2015-10-13T07:20:21.000+0000" }, { "id": "366605", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Also, the current implementation only works for {{images/shortcutItemIcon.png}} and not {{/images/shortcutItemIcon.png}} while the following works fine as it should:\r\n\r\n{code:xml}\r\n\r\n\r\n{code}\r\n\r\nSo you need to strip the first slash if found.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-10-13T07:25:26.000+0000", "updated": "2015-10-13T07:25:26.000+0000" }, { "id": "366694", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/7290\r\nPR (5_1_X): https://github.com/appcelerator/titanium_mobile/pull/7298", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-10-13T20:48:23.000+0000", "updated": "2015-10-13T20:48:23.000+0000" }, { "id": "367426", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~fokkezb] Renamed the ticket and adjusted methods to reflect the renamed methods.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-10-21T17:09:35.000+0000", "updated": "2015-10-21T17:09:35.000+0000" }, { "id": "367459", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "body": "Verified as fixed, able to use Ti.UI.iOS.ApplicationShortcuts.addDynamicShortcut() with custom images.\r\n\r\nMac OSX El Capitan 10.11 (15A284)\r\nStudio: 4.3.3.201510201834\r\nTi SDK: 5.2.0.v20151020100425\r\nAppc NPM: 4.2.1-5\r\nAppc CLI: 5.2.0-18\r\nTi CLI: 5.0.4\r\nXcode 7.0(7A218)\r\nNode v4.2.1\r\niPhone 6S Plus (9.0)\r\nproduction\r\n\r\n*Closing ticket.*", "updateAuthor": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2015-10-21T22:06:55.000+0000", "updated": "2015-10-21T22:06:55.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }