tidev / titanium-sdk

🚀 Native iOS and Android Apps with JavaScript
https://titaniumsdk.com/
Other
2.76k stars 1.21k forks source link

App crashes on cold launch with Ti.App.getArguments() if opened from App Clip #12944

Closed jasonkneen closed 3 years ago

jasonkneen commented 3 years ago

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:

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)

Expected behaviour would be for the app to cold start from an App Clip and getArguments() should return the payload without the app crashing.

hansemannn commented 3 years ago

PR: https://github.com/appcelerator/titanium_mobile/pull/12988