Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20132] Crash when creating iOS Application shortcuts without userInfo

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionDuplicate
Resolution Date2015-12-11T13:45:23.000+0000
Affected Version/sRelease 5.1.1
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterJason Kneen
AssigneeEric Merriman
Created2015-12-11T13:31:17.000+0000
Updated2017-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);     
    });
}

Comments

  1. Fokke Zandbergen 2015-12-11

    Duplicates TIMOB-20073 and already fixed as part of TIDOC-2348
  2. Lee Morris 2017-03-22

    Closing ticket as duplicate of the ticket that is mentioned above and has since been closed.

JSON Source