Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17289] iOS Safari Smart App Banner: non-empty "app-argument" crashes an app

GitHub Issuen/a
TypeBug
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterVlad Y.
AssigneeUnknown
Created2014-03-25T20:27:19.000+0000
Updated2018-02-28T20:03:55.000+0000

Description

Problem Description

Smart Banner successfully launches an app. But as soon as we try to use "app-argument" parameter to pass anything (even with a custom scheme url that app supports) app will crash right after the launch/resume due to uncaught exception: : *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: object cannot be nil (key: source)' Smart Banners doc: https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html#//apple_ref/doc/uid/TP40002051-CH6-SW2

Extra information

ERROR] The application has crashed with an uncaught exception 'NSInvalidArgumentException'. Reason: setObjectForKey: object cannot be nil (key: source) Stack trace: I think the issue is related to launchOptions dictionary. http://docs.appcelerator.com/titanium/3.0/#!/api/launchOptions It seems that Titanium code doesn't check and set nil value where it cannot be nil.

Steps to reproduce

Get the app from here: TapHunter - The Craft Beer Finder https://itunes.apple.com/us/app/taphunter-craft-beer-finder/id512023104?mt=8 (anyone compiled with the latest 3.2.3 SDK). How to reproduce: 1) Download an app (one of the mentioned above or any other you know that was built using latest SDK and are in app store) 2) Create a html page with the following meta tag: http://test.com "> Where 512023104 is the "TapHunter - The Craft Beer Finder" app id but can be your app id or 421224709 if you want to try with "Farm Progress". 3) Open this page using safari on your device with the installed app 4) Click on Smart Banner "OPEN" link and app will crash right after the launch

Comments

  1. Ritu Agrawal 2014-03-26

    Please provide a simple runnable test case to reproduce this issue and we would be happy to take a look.
  2. Vlad Y. 2014-03-26

    I will explain how to reproduce and where I think you should look for the issue. Smart App Banners work on real device only and for the apps that are in the App Store (Safari needs a real numeric itunes app id). I tried and was able to crash some other apps that are available on this page to prove that this is Titanium and not an app specific issue: http://www.appcelerator.com/customers/app-showcase/ e.g. Farm Progress https://itunes.apple.com/us/app/farm-progress/id421224709?mt=8 TapHunter - The Craft Beer Finder https://itunes.apple.com/us/app/taphunter-craft-beer-finder/id512023104?mt=8 I tried a bunch of apps but it seems that issue is reproducible for the ones that were updated in 2014. I was not able to reproduce it for the late 2013 apps. So we are talking about one of the latest versions of Titanium SDK. How to reproduce: 1) Download an app (one of the mentioned above or any other you know that was built using latest SDK and are in app store) 2) Create a html page with the following meta tag: http://test.com"> Where 512023104 is the "TapHunter - The Craft Beer Finder" app id but can be your app id or 421224709 if you want to try with "Farm Progress". 3) Open this page using safari on your device with the installed app 4) Click on Smart Banner "OPEN" link and app will crash right after the launch Device console has the same error message for all apps: [ERROR] The application has crashed with an uncaught exception 'NSInvalidArgumentException'. Reason: *** setObjectForKey: object cannot be nil (key: source) Stack trace: I think the issue is related to launchOptions dictionary. http://docs.appcelerator.com/titanium/3.0/#!/api/launchOptions It seems that Titanium code doesn't check and set nil value where it cannot be nil.
  3. Vlad Y. 2014-03-26

    If you want to test a custom version or add some debug logging. You can do this on a real app store app you own. You need to install your app from app store then don't delete it but override it with your debug version using "Deploy to iOS device" in Titanium Studio. Smart Banner will work and will crash your app.
  4. Vlad Y. 2014-04-03

    Were you able to reproduce the issue? Do you need anything else?
  5. Emmanuel Francis 2014-05-19

    This issue is still in 3.2.3 GA version. App build on 3.2.3 GA works fine on iOS 6. I haven't tested but looks like it is an issue when build with 3.2.3 GA and running on iOS 7.1.1
  6. Mauro Parra-Miranda 2014-06-30

    Hello [~vlad1k]! Thanks for your report! Do you have any testcase about how do you handle this argument in your mobile app? Best Regards,
  7. Vlad Y. 2014-07-02

    You don't need any logic to handle this argument. The problem is within Titanium. It crashes even before can reach any handler and crashes when there is no handler at all. Just pass an argument and you will see a crash.
  8. Mauro Parra-Miranda 2014-07-10

    Thanks for you report. The platform team will set the priority of this bug.

JSON Source