[TIMOB-19708] Ti.App.iOS:shortcutitemclick lacks shortcutitem type
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | None |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2015-10-13T20:58:41.000+0000 |
| Affected Version/s | Release 5.1.0 |
| Fix Version/s | Release 5.1.0 |
| Components | iOS |
| Labels | n/a |
| Reporter | Fokke Zandbergen |
| Assignee | Hans Knöchel |
| Created | 2015-10-11T11:51:22.000+0000 |
| Updated | 2015-11-20T03:37:14.000+0000 |
Description
If you define a shortcut in
tiapp.xml:
<key>UIApplicationShortcutItems</key>
<array>
<dict>
<key>UIApplicationShortcutItemIconType</key>
<string>UIApplicationShortcutIconTypeAdd</string>
<key>UIApplicationShortcutItemSubtitle</key>
<string>Take a brand new photo</string>
<key>UIApplicationShortcutItemTitle</key>
<string>Take photo</string>
<key>UIApplicationShortcutItemType</key>
<string>NewPhoto</string>
<key>UIApplicationShortcutItemUserInfo</key>
<dict>
<key>myCustomKey</key>
<string>myCustomValue</string>
</dict>
</dict>
</array>
The shortcutitemclick event will not have the shortcut's type, probably because it is overwritten by the event type:
[INFO] {
[INFO] bubbles = 1;
[INFO] cancelBubble = 0;
[INFO] source = "[object TiAppiOS]";
[INFO] subtitle = "Take a brand new photo";
[INFO] title = "Take photo";
[INFO] type = shortcutitemclick;
[INFO] userInfo = {
[INFO] myCustomKey = myCustomValue;
[INFO] };
[INFO] }
PR FR using https://github.com/appcelerator-developer-relations/appc-sample-3dtouch verifies the fix, but
iconis missing:[INFO] Ti.App.iOS:shortcutitemclick { [INFO] "title": "Take photo", [INFO] "itemtype": "NewPhoto", [INFO] "subtitle": "Take a brand new photo", [INFO] "userInfo": { [INFO] "myCustomKey": "myCustomValue" [INFO] }, [INFO] "bubbles": true, [INFO] "type": "shortcutitemclick", [INFO] "source": {}, [INFO] "cancelBubble": false [INFO] }PR (master): https://github.com/appcelerator/titanium_mobile/pull/7290 PR (5_1_X): https://github.com/appcelerator/titanium_mobile/pull/7298
Verified as fixed, defined a shortcut in the tiapp.xml & built to device. when clicking on the shortcut item the
shortcutitemclickevent fired contains the shortcut's type (("itemtype":"contact_us")) . Tested on iPhone 6S + CLI Specs Template OSX El Capitan 10.11 Studio: 4.3.1.201509302304 Ti SDK: 5.2.0.v20151014085238 Appc NPM: 4.2.1-1 Appc CLI: 5.1.0-38 Closing ticket.