You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which package manager are you using? (Yarn is recommended)
npm
If the issue is web-related, please select the bundler (web.bundler in the app.json)
None
Summary
I've encountered a bug when routing to a href from a notification (in this case using tabs). On expo-router@3.4.8, routing from a notification on ios works as expected. On android, this does not work at all. The notification message press is received and the router attempts to navigate, but nothing happens on screen (if on index) or it shows the index. In my reproducible example, the logs indicate the view the notification is supposed to route to does render, but on screen it stays on the (tabs)/index (aka Tab One) or if you are on (tabs)/three and attempt to route to /two, it will go to (tabs)/index on screen.
Example log (from reproducible example) loading the app, going to tab Three, then pressing a notification to go to tab Two:
LOG Render Tab One
LOG not mounted
LOG Render Tab Three
LOG subscription redirect
LOG redirect to: /two
LOG Render Tab Two
expo-router@3.5.0 exhibits the same behavior. This may be a separate bug, but in 3.5.0 I noticed that routing to a href from a notification with a param is broken compared to 3.4.8 (tested on ios). So for example, routing to /user/some-uuid where there is a file app/(tabs)/user/[id].tsx will render the view with id as undefined via const { id } = useLocalSearchParams().
saurori
changed the title
[router] Broken and inconsistent router behavior from push notification
[router] Routing from Push Notification on Android not working
Apr 24, 2024
Minimal reproducible example
https://github.com/saurori/expo-router-bug
Which package manager are you using? (Yarn is recommended)
npm
If the issue is web-related, please select the bundler (
web.bundler
in theapp.json
)None
Summary
I've encountered a bug when routing to a href from a notification (in this case using tabs). On
expo-router@3.4.8
, routing from a notification onios
works as expected. Onandroid
, this does not work at all. The notification message press is received and the router attempts to navigate, but nothing happens on screen (if on index) or it shows the index. In my reproducible example, the logs indicate the view the notification is supposed to route to does render, but on screen it stays on the(tabs)/index
(aka Tab One) or if you are on(tabs)/three
and attempt to route to/two
, it will go to(tabs)/index
on screen.To send a notification, I used https://expo.dev/notifications with a Data (JSON) of
{"url":"/two"}
.Example log (from reproducible example) loading the app, going to tab Three, then pressing a notification to go to tab Two:
expo-router@3.5.0
exhibits the same behavior. This may be a separate bug, but in3.5.0
I noticed that routing to a href from a notification with a param is broken compared to3.4.8
(tested on ios). So for example, routing to/user/some-uuid
where there is a fileapp/(tabs)/user/[id].tsx
will render the view withid
asundefined
viaconst { id } = useLocalSearchParams()
.Environment
The text was updated successfully, but these errors were encountered: