I'm trying to get an FCM Device push token via Notifications.getDevicePushTokenAsync()
when I run it I get this error [Error: Call to function 'ExpoPushTokenManager.getDevicePushTokenAsync' has been rejected. → Caused by: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.ikechia.v1_transport_mobile. Make sure to call FirebaseApp.initializeApp(Context) first.]
I've followed the expo documentation and registered an FCM V1 server key file in the expo dashboard. It worked but all of a sudden stopped. I registered a new FCM V1 server file (the old one was for some reason, missing in the dashboard) but to no avail.
I also tried to initialize firebase with initializeApp(firebaseConfig)
to no avial.
Any help to get my FCM Device push notification working will be much appreciated
I'm trying to get an FCM Device push token via Notifications.getDevicePushTokenAsync()
when I run it I get this error [Error: Call to function 'ExpoPushTokenManager.getDevicePushTokenAsync' has been rejected. → Caused by: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.ikechia.v1_transport_mobile. Make sure to call FirebaseApp.initializeApp(Context) first.]
I've followed the expo documentation and registered an FCM V1 server key file in the expo dashboard. It worked but all of a sudden stopped. I registered a new FCM V1 server file (the old one was for some reason, missing in the dashboard) but to no avail.
I also tried to initialize firebase with initializeApp(firebaseConfig)
to no avial.
Any help to get my FCM Device push notification working will be much appreciated
Share Improve this question edited Jan 17 at 22:27 Ike Anya asked Jan 17 at 21:57 Ike AnyaIke Anya 2012 silver badges9 bronze badges1 Answer
Reset to default 0Turns out the AndroidManifest.xml configuration can affect expo-notifications and make it not return the device token. I had to remove this xmlns:tools="http://schemas.android/tools"
in <manifest...>
and tools:node="replace"
in this <application...>
.
Then it worked!