Skip to main content

Push Notifications on Android

Use this guide after you have created your Firebase project and replaced the Android google-services.json file.

Quick Answer

Android push notifications require a matching Firebase Android app, the correct google-services.json, notification runtime permission on newer Android versions, and notification sending from a trusted backend. Do not place an FCM server key in the React Native app.

Official references:

1. Confirm Android App Identity

Make sure these values match:

  • Android package name in android/app/build.gradle;
  • Android app registered in Firebase;
  • google-services.json downloaded from the same Firebase Android app;
  • application ID used by your release build variant.

If you change the package name, download a new google-services.json.

2. Replace Firebase Config

Place the downloaded file here:

android/app/google-services.json

Then rebuild the app:

corepack yarn android

For release verification:

cd android
./gradlew app:assembleGooglePlayDebug

3. Confirm Notification Permission

Newer Android versions require runtime notification permission. The app should request it when notifications are enabled. Test both paths:

  • user accepts notifications;
  • user denies notifications.

Your app should still run when notification permission is denied.

4. Verify Token Registration

After login:

  1. Confirm the app receives an FCM token.
  2. Confirm the token is saved for the signed-in user if your app stores tokens in Firebase.
  3. Trigger a notification from a backend flow.
  4. Confirm notification behavior in foreground, background, and killed states.

5. Send from the Backend

Android notifications should be sent from Firebase Functions or another trusted backend with Firebase Admin SDK or FCM HTTP v1.

Do not send push notifications from the mobile app with a Firebase server key.

Troubleshooting

ProblemFix
No token is generatedCheck google-services.json, package name, Firebase Android app, and messaging dependencies.
Token exists but sends failCheck backend credentials, FCM HTTP v1/Admin SDK configuration, and project ID.
Notifications do not show on Android 13+Confirm runtime notification permission was requested and accepted.
Debug works but release does notCheck build variant application ID and the Firebase app tied to that package name.
Foreground notifications are silentConfirm app foreground notification handling and notification channel configuration.

Next Steps