expo-notifications failing to get token
Problem
Summary I am having issues with expo-notifications. So I created a blank project with the expo init command, created a managed workflow, and installed expo notifications via expo install. Then I copied the `registerForPushNotificationsAsync` from here, used it in a `useEffect` hook and got the following error: `[Unhandled promise rejection: Error: Fetching the token failed: java.util.concurrent.ExecutionException: java.io.IOException: AUTHENTICATION_FAILED]` Managed or bare workflow? If you have `ios/` or `android/` directories in your project, the answer is bare! managed What platform(s) does this occur on? Android SDK Version (managed workflow only) 45 Environment expo-env-info 1.0.5 environment info: System: OS: Windows 10 10.0.22000 Binaries: Node: 16.16.0 - C:\Program Files\nodejs\node.EXE npm: 8.11.0 - C:\Program Files\nodejs\npm.CMD npmPackages: expo: ~45.0.0 => 45.0.6 react: 17.0.2 => 17.0.2 react-dom: 17.0.2 => 17.0.2 react-native: 0.68.2 => 0.68.2 react-native-web: 0.17.7 => 0.17.7 Expo Workflow: managed Reproducible demo https://docs.expo.dev/versions/latest/sdk/notifications/#api
Error Output
error: `[Unhandled promise rejection: Error: Fetching the token failed: java.util.concurrent.ExecutionException: java.io.IOException: AUTHENTICATION_FAILED]`
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: expo-notifications failing to get token
same here with slightly different error message_ `Fetching the token failed: Please set your Project ID. A valid Firebase Project ID is required to communicate with Firebase server APIs: It identifies your application with Firebase.Please refer to https://firebase.google.com/support/privacy/init-options.` Note: If we push to prodution then everything works. this is only an issue in expo go
Trust Score
6 verifications
- 1
same here with slightly different error message_
same here with slightly different error message_
- 2
`Fetching the token failed: Please set your Project ID. A valid Firebase Project
`Fetching the token failed: Please set your Project ID. A valid Firebase Project ID is required to communicate with Firebase server APIs: It identifies your application with Firebase.Please refer to https://firebase.google.com/support/privacy/init-options.`
- 3
Note: If we push to prodution then everything works. this is only an issue in ex
Note: If we push to prodution then everything works. this is only an issue in expo go
Validation
Resolved in expo/expo GitHub issue #18570. Community reactions: 15 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep