[TIMOB-28513] iOS: App crashes on cold launch with Ti.App.getArguments() if opened from App Clip
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2021-08-05T13:59:23.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 10.0.2 |
Components | iOS |
Labels | AppClips, getarguments, ios |
Reporter | Jason Kneen |
Assignee | Joshua Quick |
Created | 2021-07-07T13:47:51.000+0000 |
Updated | 2021-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.
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 returnsundefined
and the deprecatedTi.App.getArguments()
function is not defined either. Basically, there is no way to grab the arguments on app startup via Titanium 10.0.0.9.3.2.GA Given this is a core feature of iOS I do think this is a priority to fix.
This still crashes when launched from an appclip (backported the fix to my local 9.3.2.GA SDK)
PR: https://github.com/appcelerator/titanium_mobile/pull/12988
[~hknoechel], I assume this will fix the "universal link" cold start issue too. What do you think? [AC-6397] [TIMOB-26610]
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
Great job Hans -- all works as expected now and iOS users can have a full app clip experience!
Merged to master and 10_0_X