Useful or not, from you.
react-native-firebase Cannot retrieve FCM token Error: SERVICE_NOT_AVAILABLE

Issue

Hi, I am using react-native-firebase for android push notifications. I have an issue with retrieving FCM token.

When I am logging error, it shows me: Error: SERVICE_NOT_AVAILABLE

Snímka obrazovky 2019-06-24 o 19 04 26

react-native-firebase: 5.2.0

android/build.gradle:

classpath 'com.android.tools.build:gradle:3.1.4'

android/app/build.gradle:

implementation project(':react-native-firebase')
implementation "com.google.android.gms:play-services-base:16.0.1"
implementation "com.google.firebase:firebase-core:16.0.6"
implementation "com.google.firebase:firebase-messaging:17.3.4"

react-native info output:

React Native Environment Info: System: OS: macOS 10.14.4 Binaries: Node: 11.5.0 npm: 6.9.0 Watchman: 4.9.0 SDKs: Android SDK: API Levels: 25, 27, 28, 29 Build Tools: 27.0.3, 28.0.3, 29.0.0 System Images: android-26 | Google APIs Intel x86 Atom npmPackages: react: ^16.6.3 => 16.6.3 react-native: ^0.57.8 => 0.57.8 npmGlobalPackages: react-native-cli: 2.0.1 react-native-git-upgrade: 0.2.7

That's a useful answer
Without any help

It isn’t documented very well, but I believe this is either a network connectivity failure or a server error of some sort. Recommendation is exponential backoff/retry. The token calls have latency anyway, so your calling code should already be able to handle it async, it just may take longer (or fail completely if there’s a network hiccup)

https://stackoverflow.com/questions/50208426/android-fcm-java-io-ioexception-service-not-available-error-on-some-devices

provisionally closing as all the docs I read indicated this was network related, and not a problem with the module, additionally I’ve been running e2e tests this morning on the module, they call getToken and have been working so I can’t reproduce