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
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
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)
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