Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-23297

Calling Ti.App.getArguments() crashes app when launched via new App Shortcuts

    Details

    • Story Points:
      5
    • Sprint:
      2016 Sprint 13 SDK

      Description

      I am testing out the new support for Application Shortcuts as described here:
      http://www.appcelerator.com/blog/2015/11/ios-9-3d-touch-sample-app/

      I have the shortcuts showing when I press on the app icon - perfect.

      However as soon as the app launches it crashes. And the reason is that when the app is launched or resumed I perform some checks for incoming parameters using the Ti.App.getArguments().

      And it seems that whenever the app is launched using a App Shortcut, then any subsequent call to Ti.App.getArguments() crashes the app.

      The crash error message is:

      [UIApplicationShortcutItem boundBridge:withKrollObject:]: unrecognized selector sent to instance 0x137d65370
      

      I will attach a sample project which has a App Shortcut set in the tiapp.xml file as follows:

      <key>UIApplicationShortcutItems</key>
      <array>
        <dict>
          <key>UIApplicationShortcutItemIconType</key>
          <string>UIApplicationShortcutIconTypeSearch</string>
          <key>UIApplicationShortcutItemTitle</key>
          <string>Search</string>
          <key>UIApplicationShortcutItemType</key>
          <string>search</string>
          <key>UIApplicationShortcutItemUserInfo</key>
          <dict/>
        </dict>
      </array>
      

      And a very simple app.js using native code:

      var win = Ti.UI.createWindow({
         backgroundColor: 'blue'
      });
      win.open();
       
      Ti.App.getArguments();
      

      Make sure the app is force closed. Then launch the app via the App Shortcut (not the app icon). It will crash with the above error.

      Tested on my iPhone 6S Plus.

        Attachments

        1. Test3dTouch.zip
          64 kB
        2. IMG_2008.jpg
          IMG_2008.jpg
          339 kB
        3. IMG_2009.jpg
          IMG_2009.jpg
          648 kB

          Activity

            People

            • Assignee:
              hknoechel Hans Knöchel
              Reporter:
              mdelmarter Matthew Delmarter
              Reviewer:
              Chee Kiat Ng (Inactive)
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-9693
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code