expo / router

[ARCHIVE]: Expo Router has moved to expo/expo -- The File-based router for universal React Native apps

Home Page:https://docs.expo.dev/routing/introduction/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Handle Push Notifications" example doesn't seem to work on Android?

sparkertime opened this issue · comments

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...

  1. Run npx create-expo-app@latest --template tabs@49
  2. Add code from https://docs.expo.dev/versions/latest/sdk/notifications/#handle-push-notifications-with-navigation

To reproduce with that repo,

  1. Add a valid projectId
  2. Test on Android device via Expo Go
  3. Use the Expo web push notification tool to send yourself a push notification

I'm unable to get push notifications working on Android with expo-router.

Having the same issue. Any updates?