-
Notifications
You must be signed in to change notification settings - Fork 62
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
Airship getInitialDeepLink() #625
Comments
The plugin will queue up the deep links if you do not have an active listener. Could you try to move the listener to when your routes are ready? |
Thanks for your answer @rlepinski. I looked again into React Navigation doc, and as far as I can tell the only way to define/handle the deep link listener is when creating the navigator initially, in this case I don't see how we could change it so that it is only being used when routes are ready. https://reactnavigation.org/docs/deep-linking/#third-party-integrations I think this is exactly why they provide 2 different methods:
They also explain that in:
Thanks again. |
getInitialUrl ties us into a weird lifecycle that I am not sure we can support properly. On iOS, the notification response comes in after the app is launched in the user notification callback. We would have to see if that callback happens before the react native context is up otherwise we will have a race condition. It use to be the push payload would be provided in the launch options but that is no longer the case. Ill have someone take a look in the next day or so to see how we can integrate into that library properly without a getInitialURL method. |
Thanks a lot! |
Sorry about the delay on this, we are trying to get this plugin compatible with 0.78 then we will get back to this. |
Hello,
Issue:
We are using Airship push notifications alongside React Navigation in our app, but we’re having trouble correctly handling deep links when the app is in the killed state.
React Navigation’s recommended approach for handling deep linking is outlined here:
React Navigation - Deep Linking
We have already set up a listener, and deep links work correctly when the app is in the foreground or background. However, when the app is killed, we encounter the following warning:
Our assumption is that the deep link is being processed before the navigation system is fully ready. React Navigation provides a way to override getInitialURL to properly handle this scenario and ensure that navigation occurs only when ready.
However, to use this solution, we need a way to retrieve the initial deep link URL from the Airship SDK.
Proposed Solution
Would it be possible to expose a method like getInitialDeepLink() in the Airship SDK?
I found a related discussion here: Issue #58, but it doesn't seem like this feature was ever implemented.
Considering that React Navigation is the most widely used navigation library for React Native, many developers would likely benefit from having a reliable way to retrieve the initial deep link when the app starts from a killed state.
Questions
Thanks a lot for looking into this! We appreciate your help.
The text was updated successfully, but these errors were encountered: