router
router copied to clipboard
"Handle Push Notifications" example doesn't seem to work on Android?
Which package manager are you using? (Yarn is recommended)
npm
Summary
We'd like to navigate to a specific tab upon receiving a push notification. This works in iOS, but in Android nothing happens. We have started with the tab navigation template for Expo 49 and added the example code from https://docs.expo.dev/versions/latest/sdk/notifications/#handle-push-notifications-with-navigation
Oddly enough, if we change initialRouteName
in unstable_settings
to a bogus value, then that code DOES work but generates warnings on Android.
My Expo-pertise is insufficient to know if this is an issue with the example code, an issue with the tab starter template, or something else.
Minimal reproducible example
https://github.com/sparkertime/android_push_notifications_tabs
This repo was created by...
- Run
npx create-expo-app@latest --template tabs@49
- Add code from https://docs.expo.dev/versions/latest/sdk/notifications/#handle-push-notifications-with-navigation
To reproduce with that repo,
- Add a valid
projectId
- Test on Android device via Expo Go
- Use the Expo web push notification tool to send yourself a push notification