Push notification guides
Push notifications on Android go through Firebase Cloud Messaging (FCM), and on iOS through Apple Push Notification service (APNs), usually with FCM in front. These guides cover the setup in Flutter and React Native, the permissions each platform asks for, and what each FCM and APNs error code means and how to fix it.
FCM and APNs error codes
What each error returned by FCM or APNs means, and whether to delete the device token. Each code links to a full guide.
| Error | Returned by | What it means |
|---|---|---|
UNREGISTERED | FCM 404 | The token is no longer valid, for example after the app was uninstalled |
INVALID_ARGUMENT | FCM 400 | The payload or the token is invalid. Check the payload before deleting the token |
SENDER_ID_MISMATCH | FCM 403 | The server sends from a different Firebase project than the token belongs to |
THIRD_PARTY_AUTH_ERROR | FCM 401 | Firebase can't authenticate with APNs: missing, revoked or expired APNs key or certificate |
BadDeviceToken | APNs 400 | The token is invalid or was sent to the wrong environment (sandbox vs production) |
No APNS token specified | iOS app | The app asked for an FCM token before iOS gave it an APNs token |
PERMISSION_DENIED | Firebase AI Logic 403 | App Check enforcement is on and the request has no valid App Check token |
Setup guides
Flutter Push Notifications: The Complete Guide for Android and iOS
Add push notifications to a Flutter app with Firebase Cloud Messaging: Android and iOS setup, permissions, foreground, background and terminated states, taps and deep links, images, sounds, delivery tracking and troubleshooting.
React Native Push Notifications: The Complete Guide for Android and iOS
Add push notifications to a React Native app for Android and iOS with Firebase Cloud Messaging: native setup, the background handler, permissions, foreground, background and closed-app behaviour, taps and deep links, images, channels, tags, attribution and sign-out.
Firebase iOS Push Notifications: APNs Key and SDK Setup
Set up Firebase Cloud Messaging on iOS step by step: create an APNs authentication key, upload it to Firebase, add the Firebase iOS SDK, request permission, and get the FCM token — plus the most common reasons iOS push fails.
POST_NOTIFICATIONS: Android 13 Notification Permission Guide
Add android.permission.POST_NOTIFICATIONS to your manifest, then request it at runtime on Android 13+. Code for Kotlin, React Native and Flutter, and how to handle denial.
When notifications don't arrive
Flutter Push Notifications Not Received in Background or When App Is Killed: Fixes
Flutter FCM notifications work in the foreground but not in the background or after the app is closed? Fix onBackgroundMessage, data-only payloads, Android battery savers, iOS background modes and more.
Fix “No APNS token specified before fetching FCM Token” on iOS (React Native & Flutter)
Why Firebase Messaging throws “No APNS token specified before fetching FCM Token” on iOS, and how to fix it in React Native, Flutter and native Swift: capabilities, registration order, method swizzling and simulators.