The firebase.messaging().getToken() works in most devices I've tested expect a Huawei Nova 3i. When I run the firebase.messaging().getToken() method inside a try block, an error get caught. The error object reads Error: AUTHENTICATION_FAILED. On inspecting the properties of the Error object I get
{
framesToPop: 1,
code: messaging/fcm-token-error
}
Using the following code to inspect the error,
console.log('error', error);
for (const field in error) {
console.log(field, error[field]);
}
gives this

ios/Podfile:# N/A
AppDelegate.m:// N/A
android/build.gradle:// N/A
android/app/build.gradle:// N/A
android/settings.gradle:// N/A
MainApplication.java:// N/A
AndroidManifest.xml:<!-- N/A -->
ADD_SOMETHING_HERE e.g. iOS 10 or Android API 28N/AN/AN/AADD_SOMETHING_HERE e.g. Xcode 10, Android Studio 3.2React Native version:0.57.8React Native Firebase library version:5.2.0Firebase module(s) you're using that has the issue:TypeScript?N/AExpoKit?ExpoKitN/A
Think react-native-firebase is great? Please consider supporting the project with any of the below:
React Native Firebase and Invertase on Twitter+1
getting the same error when trying to call firebase.messaging().getToken()
EDIT:
Turns out my emulator didn't have google play services installed and the one I tried before that had an older version. After I created a new emulator with API 28 with google play, it worked again.
Please see https://rnfirebase.io/docs/v5.x.x/troubleshooting/android#Google-Play-Services-related-issues and the sections following it on how to check for valid play services installation.
I am still facing this issue while trying to call firebase.messaging().getToken()
Error: AUTHENTICATION_FAILED
at createErrorFromErrorData (NativeModules.js:152)
at NativeModules.js:104
at MessageQueue.__invokeCallback (MessageQueue.js:442)
at MessageQueue.js:127
at MessageQueue.__guard (MessageQueue.js:343)
at MessageQueue.invokeCallbackAndReturnFlushedQueue (MessageQueue.js:126)
at debuggerWorker.js:80
App.js:335
According to the react-native-firebase documentation, I executed the following function to know the status of my emulator's play services version
async function checkPlayServicesBasicExample() {
const utils = firebase.utils();
const {
isAvailable,
hasResolution,
isUserResolvableError,
} = utils.playServicesAvailability;
// all good and valid \o/
if (isAvailable) return Promise.resolve();
// if the user can resolve the issue i.e by updating play services
// then call Google Play's own/default prompting functionality
if (isUserResolvableError) {
return utils.promptForPlayServices();
}
// call Google Play's own/default resolution functionality
if (hasResolution) {
return utils.resolutionForPlayServices();
}
// There's no way to resolve play services on this device
// probably best to show a dialog / force crash the app
return Promise.reject(
new Error('Unable to find a valid play services version.')
);
}
I got a positive result saying that the device has a valid play services installation. I am using an Android emulator with API 29 and Android 10 (Google API)
So far, I don't understand what the issue is
Open AVD manager window in android studio and click "Wipe Data". It could helps a lot

I am also facing same issue in nova 7i also install play store and play services
@smismailalam Hi. Have you managed to get notifications to work on your huawei device?
Most helpful comment
Open AVD manager window in android studio and click "Wipe Data". It could helps a lot
