最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

react native - Expo Device FCM push notification not working - Stack Overflow

programmeradmin5浏览0评论

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 badges
Add a comment  | 

1 Answer 1

Reset to default 0

Turns 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!

发布评论

评论列表(0)

  1. 暂无评论