Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28513] iOS: App crashes on cold launch with Ti.App.getArguments() if opened from App Clip

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2021-08-05T13:59:23.000+0000
Affected Version/sn/a
Fix Version/sRelease 10.0.2
ComponentsiOS
LabelsAppClips, getarguments, ios
ReporterJason Kneen
AssigneeJoshua Quick
Created2021-07-07T13:47:51.000+0000
Updated2021-08-05T13:59:23.000+0000

Description

If an App Clip has been added to an app, and the user opens the App Clip via a QR code etc, the normal process is for either a) the App Clip runs independently if the host app isn't installed or b) the host app is launched if installed. In the case of b), if the app is running this works and the app clip opens the app and getArguments() can be used to get the resultant data from the app clip. If however the app is closed, when the user opens from the app clip the app opens and immediately crashes when getArguments is called. The error is: {quote}Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString count]: unrecognized selector sent to instance 0x10981d400' First throw call stack: (0x19a802754 0x1af2c97a8 0x19a705c3c 0x19a8052ac 0x19a8075b0 0x103921d2c 0x103921c14 0x19bbc8d4c 0x19a7a1cb0 0x19a7a3284 0x1038e3520 0x1039211d4 0x19bbd5458 0x19a77d22c 0x19a77ce28 0x19a77c278 0x19a77602c 0x19a775360 0x1b1db3734 0x19d1f0584 0x19d1f5df4 0x10252e550 0x19a431cf8){quote} Expected behaviour would be for the app to cold start from an App Clip and getArguments() should return the payload without the app crashing.

Comments

  1. Joshua Quick 2021-07-14

    Which version of the Titanium SDK are you having this issue on? _(I'm assuming you're running Titanium 9.x.x?)_ I ask, because there is a *regression* in Titanium 10.0.0 where the Ti.App.arguments always returns undefined and the deprecated Ti.App.getArguments() function is not defined either. Basically, there is no way to grab the arguments on app startup via Titanium 10.0.0.
  2. Jason Kneen 2021-07-14

    9.3.2.GA Given this is a core feature of iOS I do think this is a priority to fix.
  3. Jason Kneen 2021-07-14

    This still crashes when launched from an appclip (backported the fix to my local 9.3.2.GA SDK)
  4. Hans Knöchel 2021-07-29

    PR: https://github.com/appcelerator/titanium_mobile/pull/12988
  5. Joshua Quick 2021-07-29

    [~hknoechel], I assume this will fix the "universal link" cold start issue too. What do you think? [AC-6397] [TIMOB-26610]
  6. Hans Knöchel 2021-07-29

    Yep, that works the same. But instead of using getArguments(), one can listen to the "continueactivity" event instead (like we do) that solves those as well
  7. Jason Kneen 2021-07-30

    Great job Hans -- all works as expected now and iOS users can have a full app clip experience!
  8. Ewan Harris 2021-08-05

    Merged to master and 10_0_X

JSON Source