Expo SDK version: 41.0.0
Expo is not able to authenticate with FCM. I have read every other post about this and no other solution has worked for me. FCM authentication also fails when using the online expo notification tool, with a supplied push notification token.
I have retrieved the correct server key from my firebase console and successfully uploaded to expo.
When I run “expo push:android:show”, I do get the correct FCM API key from beginning to end.
I have also tested the server key using curl against a firebase endpoint, and it authenticates successfully, so I do not believe there is an issue with the key itself.
What other reasons could there be for failed authentication?
EDIT: So, I just noticed in the expo console, on the credentials screen for the project, there are two tabs: Android (classic) and Android (EAS). I deleted the FCM server key from the classic tab and uploaded it to the EAS tab. Still getting the same error. What am I missing?
Hey,
i’m running into the same issue. I followed your steps, removed the API key from the Android (classic) and added it to the Android (EAS) but i’m still getting the same error. so strange…
@haibert have you uploaded the key with expo push:android:upload
?
Yes, at a point I had both uploaded, but I removed it, and only uploaded to the EAS, should I be doing both?
@haibert I deleted your reply because it contained your FCM API key. For anyone else finding this- it looks like uploading your key via the CLI fixes it. We’re aware of this issue in the website GUI and are working on a fix now
Ty Charlie!
I had actually scrambled random letters into the Server Key and just left it for a very clear example but ty for looking out. Also I think the following steps should be included in the documentation for implementing push notifications in custom clients situations.
- Run eas credentials choose Android, then choose Push Notifications: Manage your FCM Api Key, then paste your API key here.
- Go to expo.dev and in your projects credential tab go to Android (EAS) and also paste it there.
- Set up your iOS push notification credentials by running run expo credentials:manager -p ios , then select Use existing Push Notifications Key in current project or use a new one…
4.Make sure to include the experience id in your getExpoPushTokenAsync call. The experience id is @username/appSlug.
- use experienceId in your get token call even though its not a bare project.
token = await Notifications.getExpoPushTokenAsync({
experienceId: '@username/projectSlug,
})
Any updates? am still having this issue, even though I followed all the steps.
We’re still in the process of fixing the GUI on expo.io, so use expo push:android:upload