-
Notifications
You must be signed in to change notification settings - Fork 113
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
Using unstable_settings breaks deep linking in the app when it's in the foreground or background #818
Comments
Does it work if you did not export the unstable_settings object? I am trying to add deep linking to my expo app using expo-router, i am also using a dev build. How react-navigation does it by adding a linking prop to the navigation container like this
I am trying to replicate the exact same thing using expo-router but i could not find documentation or a tutorial covering that. And your workaround is exactly what i am currently using right now. I don't mind not exporting the unstable_settings if there is an actual way to implement this. |
Yes it works if you don't export Router handles the routing config using the folder layout in the app directory. It does not handle app / universal links though. You'll want to refer to https://docs.expo.dev/guides/deep-linking/ |
I'll echo what @usmangurowa said. I am getting the exact issue you are describing, but without even exporting I've tested both on android and ios, with expo go and native. I'm using expo SDK 49 and expo-router v2.0.1 |
Did a bit more testing, and it seems like my issue is actually caused by my nested stack setup. When deep linking to a top-level screen, I'm experiencing the issue the exact same way as @GibbyBox described. My nested stack setup for reference:
|
Its unfortunate how unclear the docs are written on how this all works. Same issue for me. Whats even weirder is that this only happens for built apps, expo go works as expected. This errors on the latest expo sdk 49 and expo router 2.0.0 builds. When exporting linking is not working. Removing it makes it work. @marklawlor are we doing anything wrong here? export const unstable_settings = {
initialRouteName: "(tabs)/index",
}; |
|
Looks like expo-router was moved into expo. Perhaps we should move this issue too? |
Is this going to be fixed? Currently if the application is behind authentication deep linking is really hard to implement. |
I confirm that for |
Any chance that this got fixed? It's annoying in projects that we need to use unstable_settings and deeplink. |
Just got bitten by this as well today. Not a fun debugging experience until I remembered adding unstable_settings recently. |
Ditto. I don't have 'unstable_settings" |
Which package manager are you using? (Yarn is recommended)
yarn
Summary
Exporting
unstable_settings
(even an empty object) prevents deep linking from working in an app that is in the foreground or the background. The app will be brought to the foreground, just not to the requested screen. Deep linking when the app is closed works fine.A warning is thrown when this issue occurs.
I tested this on both router v1.7.7 (repro's
master
branch) and v2.0.0 (repro'swith-router-v2
branch) using the ios simulator. I haven't used android and I tried setting it up to test but uri-scheme wasn't opening up expo :/Workaround
Currently, I'm using this as a workaround in my app since I need to use
unstable_settings
for the back button behavior.Minimal reproducible example
https://github.com/GibbyBox/expo-router-deeplink-repro
The text was updated successfully, but these errors were encountered: