Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when deep linking on app boot #226

Closed
zibs opened this issue Oct 17, 2020 · 5 comments
Closed

Error when deep linking on app boot #226

zibs opened this issue Oct 17, 2020 · 5 comments

Comments

@zibs
Copy link

zibs commented Oct 17, 2020

Hi Segment,

I'm seeing an error on a deep linking cold boot:

Exception 'key `url` is a NSURL and can't be serialized for delivery.' was thrown while invoking setup on target RNAnalytics with params (
etc...
)

This occurs on the simulator when I boot the app with a command like:

xcrun simctl openurl booted appSchemeName://path/to/link/to

Notably, this doesn't occur when using universal links, and doing something like

xcrun simctl openurl booted https://appSchemeName.com/path/to/link/to

This error is most likely a bug within the Segment RNAnalytics library as it only happens when using the trackApplicationLifecycleEvents flag during init, which causes a crash in the library in this line when it tries to send the _bridge.launchOptions since it seems to have trouble dealing with UIApplicationLaunchOptionsURLKey that our deep link opens with. Hence the error 'key url is a NSURL and can't be serialized for delivery.'

If we disable the trackApplicationLifecycleEvents, it doesn't happen, but I'd like to use that.

Any thoughts here? I can provide more info too if necessary.

relevant packages:

"@segment/analytics-react-native": "^1.3.1",
"react-native": "0.63.3"
@kurniawanw0194
Copy link

I got the same issue.

@zibs
Copy link
Author

zibs commented Oct 26, 2020

Any updates here?

@noobDev88
Copy link

when debug, i found they has Assert here http://prntscr.com/v9woko, and when you open with deeplink, the url is handled by launchOptions[UIApplicationLaunchOptionsURLKey] in http://prntscr.com/v9wpqi has NSURL type, so, it doesn't match with type that can be serialized.

@sregg
Copy link

sregg commented Nov 4, 2020

Seems like it was fixed in the iOS repo:
Issue: segmentio/analytics-ios#947
PR: segmentio/analytics-ios#962

Hopefully we'll get a new release of the pod and the npm soon 🤞

@MateuszRostkowski
Copy link

I've struggled with this issue on 1.3.1 version. After upgrading to 1.3.2 everything works fine 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants