expo: [expo-notifications] DeviceNotRegistered: The recipient device is not registered with FCM.
š Bug Report
Summary of Issue
token = (await Notifications.getExpoPushTokenAsync({ experienceId: experienceId })).data; retrieves invalid push tokens Here are some:
ExponentPushToken[0J23tlOl6Qz92gG9SM4ceI] ExponentPushToken[qcL4EiLB_aTct8VdVsXFfu] ExponentPushToken[D5PQ0qDWvvDqoomMg8I2G8]
Environment - output of expo diagnostics & the platform(s) youāre targeting
Bare workflow
Expo CLI 3.22.3 environment info:
System:
OS: Windows 10 10.0.18362
Binaries:
Node: 14.4.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.4 - C:\Users\Myself\AppData\Roaming\npm\yarn.CMD
npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD
npmPackages:
expo: ^38.0.8 => 38.0.8
react: ~16.11.0 => 16.11.0
react-dom: ~16.11.0 => 16.11.0
react-native: ~0.62.2 => 0.62.2
react-native-web: ~0.11.7 => 0.11.7
Reproducible Demo
Steps to Reproduce
retrieved token with token = (await Notifications.getExpoPushTokenAsync({ experienceId: experienceId })).data;
https://exp.host/--/api/v2/push/send
POST
{
"to": "ExponentPushToken[qcL4EiLB_aTct8VdVsXFfu]",
"sound": "default",
"title": "Test",
"body": "Test",
"data": { "data": "goes here" }
}
Expected Behavior vs Actual Behavior
{
"data": {
"id": "20ede6dd-95d8-484d-96aa-3560c21031a3",
"status": "error",
"message": "The recipient device is not registered with FCM.",
"details": {
"error": "DeviceNotRegistered",
"fault": "developer"
}
}
}
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 29 (10 by maintainers)
Iāve followed all those steps⦠otherwise it would not work at all⦠š¤·āāļø BTW, iām running these latest tests on LDPLayer. Can that be the problem?
Deleting the app and reinstalling it will generate a new Expo push token
As Iāve stated above, Expo is simply forwarding this error message along from FCM. Weāve had this error message posted a few times, and itās always been a configuration issue, or the deviceās token is no longer valid (app hasnāt been opened in a while or the user revoked notification permissions).
Hereās a great list of common mistakes when setting up FCM notifications in Expo.
Googleās documentation is very clear that if you receive this message, you should stop sending notifications to the app:
@Ciberusps thereās a section in the
expo-notificationsmodule docs guide specifically for this - https://github.com/expo/expo/tree/master/packages/expo-notifications#add-your-projects-credentials-to-expo-server-optional - and it links to that page š