Skip to main content

Set Up Push Notifications

Instamobile React Native apps use Firebase Cloud Messaging for push notification delivery on Android and iOS. The mobile app registers for notifications and stores device tokens. A trusted backend sends notifications to those tokens.

Quick Answer

Do not put Firebase server keys or service account secrets in the React Native app. Configure your Firebase project, upload APNs credentials for iOS, install the correct Firebase config files, and send notifications from Firebase Functions or another trusted backend using the Firebase Admin SDK or FCM HTTP v1 API.

Official references:

How Push Works

PartResponsibility
React Native appRequests permission, receives an FCM token, stores or updates the token for the signed-in user.
Firebase projectOwns iOS and Android app registrations, GoogleService-Info.plist, google-services.json, and APNs credentials.
BackendSends push messages with Firebase Admin SDK or FCM HTTP v1.
FirestoreStores user notification preferences and device tokens if your app uses Firebase.
APNsDelivers notifications to iOS devices through Firebase's APNs integration.

Required Setup

  1. Create your Firebase project.
  2. Add the iOS app with the production bundle identifier.
  3. Add the Android app with the production package name.
  4. Replace GoogleService-Info.plist.
  5. Replace google-services.json.
  6. Configure APNs for iOS.
  7. Confirm notification permissions and token registration in the app.
  8. Send notifications from a trusted backend.
  9. Test on real devices before store submission.

Backend Sending

If your app includes Firebase Functions, use the Firebase Admin SDK from Functions to send notifications. If your backend is not Firebase, use the FCM HTTP v1 API from a trusted server.

Never send push notifications directly from the mobile app with a server key.

Search your source code for these notification entry points:

rg "sendPushNotification|notificationManager|messaging\\(|getToken|onMessage"

Typical send locations:

  • new chat message;
  • new friend request;
  • order status changed;
  • driver dispatch event;
  • appointment booking update;
  • admin announcement;
  • media or comment notification.

Production Safety Checklist

  • No FCM server key or service account JSON is committed to the mobile app.
  • Backend uses Firebase Admin SDK or FCM HTTP v1.
  • Notification sends are authenticated.
  • Users can opt out of non-critical notifications if required by your product.
  • Device tokens are refreshed when Firebase returns a new token.
  • Invalid tokens are removed after send failures.
  • Notification content does not expose private data on the lock screen.
  • Push flows are tested on real iOS and Android devices.
  • Store privacy forms disclose notification usage.

Next Steps