For a long time (over a year), we have been receiving random exceptions when posting them to Expo servers, using the Ruby SDK, always related to the FCM credentials:
Exponent::Push::InvalidCredentialsError: Unable to retrieve the FCM server key for the recipient's app. Make sure you have provided a server key as directed by the Expo FCM documentation.
However, in our tests, notifications work, and if we run expo push:android:show, we get back our FCM key, with status OK; however, since expo raises this exception randomly, we are dropping some notifications daily.
I opened a post about this in Jan/2019, but received no replies from the Expo team.
At some point I had the same “random” behavior of some notifications not arriving and it turned out that if you have (in your server) let’s say [push_token1, push_token2] AND those tokens are from different “expo experiences”, then expo will fail at sending notifications for those tokens within the same sdk call. I reached that situation because of using different expo users when running the app on expo-cli. So what I did was to send the token and the experienceId to my server, so I can avoid a developer mistake (basically I group the sdk calls to send notifications by experienceId). This is not very well documented. Check my response here.
Again, probably this is not your problem but there’s a chance.
Hi there @mambrosi.vimbly, thanks for the suggestion, but I double checked our backend code and we loop through each ExpoToken individually before calling the API (our backend was coded this way before Expo had support for an array of tokens, so we call it once for every token we have on store).