[TIMOB-20132] Crash when creating iOS Application shortcuts without userInfo
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2015-12-11T13:45:23.000+0000 |
Affected Version/s | Release 5.1.1 |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | Jason Kneen |
Assignee | Eric Merriman |
Created | 2015-12-11T13:31:17.000+0000 |
Updated | 2017-03-22T20:49:17.000+0000 |
Description
Create dynamic application shortcuts in iOS, and if you don't specify userinfo, they are created but will crash if you try to access them using the event listener.
In the example below, the entries that have user info will console.log correctly the contents of e however the one without user info will crash the app.
if (OS_IOS && Ti.UI.iOS.forceTouchSupported) {
var appShortcuts = Ti.UI.iOS.createApplicationShortcuts();
appShortcuts.addDynamicShortcut({
itemtype: "post_text",
title: "Text",
subtitle: "Tap to post text",
icon: Ti.UI.iOS.SHORTCUT_ICON_TYPE_COMPOSE
});
appShortcuts.addDynamicShortcut({
itemtype: "post_photo",
title: "Photo",
subtitle: "Tap to post a photo",
icon: Ti.UI.iOS.SHORTCUT_ICON_TYPE_CAPTURE_PHOTO
});
appShortcuts.addDynamicShortcut({
itemtype: "post_video",
title: "Video",
subtitle: "Tap to post a video",
icon: Ti.UI.iOS.SHORTCUT_ICON_TYPE_CAPTURE_VIDEO,
userInfo: {
action: "video"
}
});
Ti.App.iOS.addEventListener('shortcutitemclick', function(e) {
console.log(e.itemtype);
});
}
Duplicates TIMOB-20073 and already fixed as part of TIDOC-2348
Closing ticket as duplicate of the ticket that is mentioned above and has since been closed.