I am implementing Firebase Cloud Messaging (FCM) in a React Native app. The notifications work perfectly on iOS but are not received on Android devices.
FCM Console reports notifications as "Sent" (186 sent, 0 received). No notifications appear on the Android device (foreground, background, or killed state). iOS devices receive notifications without issues. What I Have Tried (Debugging Steps) Confirmed the device receives FCM tokens. The FCM token is generated and stored in my backend. Example token: eGZN_UEfQiueuOAIuyQyNa:APA91bH...
Sent test messages via cURL and Firebase Admin API. The FCM API returns a success response. Example response: Message name: projects/picksleague/messages/0:1741651045657907%e6031bc4e6031bc4 However, no notification appears on the Android device.
Checked Android logs using adb logcat -s FirebaseMessaging. No logs appear when sending notifications, and FirebaseMessagingService does not trigger.
Confirmed MyFirebaseMessagingService is implemented. Logs inside onMessageReceived() never print.
Checked AndroidManifest.xml to ensure the service is declared. The service MyFirebaseMessagingService is defined with an intent filter for com.google.firebase.MESSAGING_EVENT.
Checked app permissions using adb shell dumpsys package com.pb_mobile_app | grep RECEIVE. Permissions such as com.google.android.c2dm.permission.RECEIVE and android.permission.RECEIVE_BOOT_COMPLETED are granted.
Checked Firebase Dependencies in android/app/build.gradle. Firebase Messaging is implemented with firebase-bom version 32.7.3 and firebase-messaging.
Ran adb shell dumpsys activity services | grep FirebaseMessagingService. The service is running but never triggered.
My Questions Why is Firebase reporting "Sent" but no notifications appear on Android? How can I debug why MyFirebaseMessagingService.onMessageReceived() never triggers? What else can I check to diagnose why Android devices never receive FCM messages? Would appreciate any guidance on how to fix this.
I am implementing Firebase Cloud Messaging (FCM) in a React Native app. The notifications work perfectly on iOS but are not received on Android devices.
FCM Console reports notifications as "Sent" (186 sent, 0 received). No notifications appear on the Android device (foreground, background, or killed state). iOS devices receive notifications without issues. What I Have Tried (Debugging Steps) Confirmed the device receives FCM tokens. The FCM token is generated and stored in my backend. Example token: eGZN_UEfQiueuOAIuyQyNa:APA91bH...
Sent test messages via cURL and Firebase Admin API. The FCM API returns a success response. Example response: Message name: projects/picksleague/messages/0:1741651045657907%e6031bc4e6031bc4 However, no notification appears on the Android device.
Checked Android logs using adb logcat -s FirebaseMessaging. No logs appear when sending notifications, and FirebaseMessagingService does not trigger.
Confirmed MyFirebaseMessagingService is implemented. Logs inside onMessageReceived() never print.
Checked AndroidManifest.xml to ensure the service is declared. The service MyFirebaseMessagingService is defined with an intent filter for com.google.firebase.MESSAGING_EVENT.
Checked app permissions using adb shell dumpsys package com.pb_mobile_app | grep RECEIVE. Permissions such as com.google.android.c2dm.permission.RECEIVE and android.permission.RECEIVE_BOOT_COMPLETED are granted.
Checked Firebase Dependencies in android/app/build.gradle. Firebase Messaging is implemented with firebase-bom version 32.7.3 and firebase-messaging.
Ran adb shell dumpsys activity services | grep FirebaseMessagingService. The service is running but never triggered.
My Questions Why is Firebase reporting "Sent" but no notifications appear on Android? How can I debug why MyFirebaseMessagingService.onMessageReceived() never triggers? What else can I check to diagnose why Android devices never receive FCM messages? Would appreciate any guidance on how to fix this.
Share asked Mar 11 at 1:11 Kostas DrosatosKostas Drosatos 114 bronze badges 2- notifee.app/react-native/docs/integrations/fcm you can prefer this link – Mahammad Momin Commented Mar 11 at 5:47
- you can check this rnfirebase.io also – Mahammad Momin Commented Mar 11 at 5:49
1 Answer
Reset to default 0Did you add the following tag in manifest?
<service
android:name=".yourpackage.MyFirebaseMessagingService"
android:directBootAware="true"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744817861a4595437.html
评论列表(0条)