Firebase Cloud Messaging failures are usually traceable to a small set of issues: an expired or incorrectly stored token, a missing platform permission, a payload that behaves differently in the foreground, or a deep link that is not handled by the app. This guide provides a repeatable troubleshooting process for Android, iOS, and web apps, including a platform comparison, token-lifecycle checklist, payload guidance, background-versus-foreground diagnostics, and a release verification worksheet.
Overview
When a Firebase notification is not received, avoid changing several variables at once. First establish whether FCM accepted the message, whether the target token is valid, whether the operating system permitted delivery, and whether the application handled the message in the expected state. These are separate stages, and success at one stage does not prove success at the next.
A useful mental model is:
- Registration: the app obtains an FCM registration token.
- Storage: the token is associated with the correct user, installation, and environment.
- Send: your server, Firebase console, or another trusted sender targets that token, topic, or condition.
- Transport and platform handling: FCM and the operating system process the request according to platform rules, permissions, and device state.
- Application handling: the app displays the notification, invokes message-handling code, or routes the user to a destination after a tap.
Investigate in that order. If a token was never stored, payload debugging will not help. If delivery succeeds but a tap opens the wrong screen, investigate notification data and navigation rather than token registration.
| Platform | Check first | Common handling difference |
|---|---|---|
| Android | Runtime notification permission, app notification settings, token refresh, and notification channel configuration | Foreground and background behavior can differ, and channel settings may affect visibility and sound. |
| iOS | Authorization status, APNs-related configuration, token registration, and notification presentation settings | The app's foreground presentation and background execution rules require explicit testing on physical devices. |
| Web | Browser permission, service worker registration, HTTPS deployment, and the web push configuration | Background delivery depends on the service worker and browser behavior; a page's foreground code is not the whole delivery path. |
Platform APIs and permission requirements change over time. Confirm the current Firebase SDK documentation and operating-system requirements before treating a platform-specific assumption as permanent.
How to estimate
For notification investigations, estimate outcomes by counting each stage rather than relying on a single “sent” or “delivered” label. Create a small test matrix with these columns:
- Platform and OS version
- App build, Firebase project, and environment
- User or installation identifier
- Token creation or refresh time
- Permission state
- App state: foreground, background, or terminated
- Message type and payload identifiers
- Observed result: received, displayed, tapped, or not observed
For a controlled test, send one message to one known installation and record a unique message ID or correlation ID in the payload. Then compare server logs, FCM responses, device logs, and application logs. Repeat with a notification-only payload, a data payload, and a combined payload where your platform implementation supports them. This separates transport problems from application-routing problems.
For a rough delivery investigation, calculate these stage counts:
valid tokens ÷ tokens attemptedmessages accepted ÷ messages requestedmessages observed by the app ÷ messages acceptedcorrect destinations ÷ notification taps
These ratios are diagnostic indicators, not guaranteed delivery metrics. They are useful because they expose where the population drops. A low valid-token ratio points to token lifecycle or storage problems. A normal send response with no foreground callback points to app-state handling, permissions, or platform configuration. A normal tap count with incorrect destinations points to deep-link data or navigation code.
Inputs and assumptions
Token-lifecycle checklist
- Generate or retrieve the token only after the messaging SDK is initialized.
- Send the token to a trusted backend over an authenticated request.
- Store more than one token per user when a user can sign in on multiple installations.
- Record platform, app version, environment, last-seen time, and an installation identifier.
- Handle token-refresh events and update the backend idempotently.
- Do not assume a token is permanent, transferable between projects, or valid after an app restore or environment change.
- Remove or deactivate tokens when the sender reports that they are no longer valid.
- Prevent a signed-out user’s installation from continuing to receive private account notifications.
Keep token records separate from authorization decisions. A valid FCM token proves that an installation can be targeted; it does not prove that the current user may receive every message associated with an account. Review the data model and access controls alongside your notification code. The Firebase Security Rules Audit can help with the broader authorization review.
Permission and payload reference
Test permission states explicitly: not yet requested, granted, denied, restricted where applicable, and disabled later in system settings. Test both a fresh installation and an upgrade. A message may be accepted by the sender while the operating system prevents visible presentation because permission is absent or notifications are disabled.
Keep payloads purposeful. A notification payload generally describes user-visible content, while data fields carry application-specific values such as an entity ID or destination. Treat all client-received data as untrusted input: validate identifiers, avoid placing secrets in payloads, and keep the payload small enough for the current platform and API constraints. Do not depend on a data callback being executed at an arbitrary time when the app is backgrounded or terminated.
For navigation, prefer a stable route key and resource ID over a fragile screen name. For example, send type: "message" and messageId: "...", then let the app resolve the destination after authentication and data validation. This makes notification taps safer when the user is signed out, the record has been deleted, or the app has changed its navigation structure.
Worked examples
Example 1: The notification never appears
- Confirm that the test installation registered a token after the current build started.
- Check that the backend stored the latest token under the intended project and environment.
- Send to that single token and inspect the sender response for invalid or rejected targets.
- Confirm platform permission and system notification settings on the physical device or browser.
- Test while the app is open, backgrounded, and terminated.
- Inspect foreground callbacks, background handlers, and service-worker logs where relevant.
If the message appears only while the app is open, compare the foreground code path with the platform's background notification path. A foreground callback may require your application to create or present its own local UI; receiving a message does not necessarily mean the operating system will show a banner automatically.
Example 2: Notifications arrive twice
Look for two presentation paths handling the same event. A combined notification-and-data message may be displayed by the operating system in one app state while application code also creates a local notification. Also check whether the server sends to both an individual token and a topic, or whether a retry mechanism lacks an idempotency key. Log a unique event ID and message ID at send, receive, display, and tap stages. Deduplicate using that identifier rather than message text.
Example 3: The tap opens the wrong screen
Log the exact data received at tap time, then trace the route-selection code. Confirm that the app handles cold-start taps as well as taps while already running. Delay navigation until authentication and required data are ready, and define a fallback for missing or unauthorized resources. Use the Firebase Cloud Messaging Implementation Guide as a companion for token, topic, and delivery-debugging patterns.
Release verification worksheet
Before release, record a pass or fail for each item:
- Fresh-install token registration and backend storage
- Token refresh after reinstall, restore, or app data changes
- Permission request, denial, and later re-enablement
- Foreground receipt and presentation
- Background receipt and presentation
- Terminated-app tap handling
- Invalid-token cleanup
- Signed-out and multi-account behavior
- Duplicate-send and retry behavior
- Deep links to existing, deleted, and unauthorized records
- Android, iOS, and web configuration for the release environment
When to recalculate
Revisit this troubleshooting process whenever you change the Firebase messaging SDK, app package or bundle configuration, notification permission flow, service worker, backend sender, payload schema, navigation system, or authentication lifecycle. Repeat it after an operating-system release that changes notification behavior, after migrating Firebase projects or environments, and whenever delivery reports show a new pattern of invalid tokens or missing messages.
For routine maintenance, review token records and test results at least once per release cycle. Keep a small permanent device matrix rather than testing only one developer device. When an incident occurs, preserve the token environment, app version, permission state, message ID, payload shape, and app state before attempting a fix. That evidence makes it possible to distinguish a code regression from a stale token, configuration mismatch, or platform behavior change.
Finally, automate what can be automated: token-registration tests, emulator or local integration checks where supported, payload schema validation, and logs that connect send events to application handling. The Firebase Emulator Suite Testing Guide and Firebase Crashlytics Triage Guide provide useful adjacent workflows. A disciplined release worksheet turns “Firebase notification not received” from a vague report into a sequence of verifiable decisions.