Test notifications from the Firebase console arrive fine, but real notifications don't reach devices, or only arrive inconsistently between foreground and background states.

Handle foreground and background messages separately, confirm the device token is registered correctly, and verify platform-specific push configuration (APNs for iOS, notification channels for Android).

Step-by-Step Guide

1

Verify google-services.json / GoogleService-Info.plist match the correct Firebase project

2

Log the FCM token on device and confirm it's saved server-side

3

Explicitly request notification permission on iOS and Android 13+

4

Handle FirebaseMessaging.onMessage (foreground) and onBackgroundMessage (background) separately

5

Create a notification channel for Android 8+ before sending notifications

6

Confirm a valid APNs certificate or key is uploaded for iOS in the Firebase console

7

Send a test message via the Firebase console using the exact device token

8

Check battery optimization settings aren't killing the app in the background on some Android devices

Found an issue with this solution?

Related Topics

fcm token refresh handlingandroid notification channelsios apns certificate setup