I got “Error: Couldn’t get GCM token for device” as well.
I am just testing the push notification example on documentation, but it always throws Error: Couldn’t get GCM token for device when executing Notifications.getExpoPushTokenAsync().
I have tried both expo SDK25 SDK28 on android 8.0 and ios 10, and none of them can get GCM token.
Any thoughts?
Update: Notifications.getExpoPushTokenAsync() works perfectly in my project after I start my project with expo start instead of react-natives-scripts start.
Hi. Instead of using the command react-native-scripts start I’m using exp start which is the CLI tool from Expo: https://github.com/expo/exp. Doing this, the function Notifications.getExpoPushTokenAsync is working well again. I’m afraid that CRNA is outdated (no new commits in the past two months: https://github.com/react-community/create-react-native-app/issues/722) and that’s the reason why we have problems with Expo using CRNA.
So i am having the same issue, ive created a feature 2months ago based on https://docs.expo.io/versions/latest/guides/push-notifications which it worked great. But apparently as ive attempted to check it today i am receiving the " [Unhandled promise rejection: Error: Couldn’t get GCM token for device] " error . I created a new project from scratch using
copy /pasted the code from documentation and run my app with exp start . But still i am getting the " [Unhandled promise rejection: Error: Couldn’t get GCM token for device] " error on
let token = await Notifications.getExpoPushTokenAsync();
I’m getting this issue as well. Has anyone notified React Native devs of the issue?
Using exp start appears to have worked. I also added the information for my Firebase account, but I can’t tell which of those changes caused the app to work. I’m not building the app as an android app, just running it through Expo.
Alas exp start didnt work for me either.
I’ve followed the FCM guide.
Strangely i can’t even request notifications permission anymore on iOS!
I get an “E_NOTIFICATIONS_TOKEN_REGISTRATION_FAILED” error, “Expo push notifications is supported only for Expo projects.”