Overview
Android push notifications use Firebase Cloud Messaging (FCM). The app registers a native FCM token, stores it indevice_tokens, and the API sends messages via the FCM HTTP v1 API.
Key pieces in this repo:
apps/mobile/lib/notifications.tsapps/mobile/app/onboarding/push-notifications.tsxapps/api/src/lib/push/fcm.tsapps/api/src/routes/api/push.tsapps/api/src/routers/push.ts
Client Setup (Android)
- Download
google-services.jsonfrom the Firebase console for the Android app. - Place it at:
- Confirm
app.config.tspoints to it:
-
Replace placeholder values in
app.config.ts(package name / bundle ID, URL schemes, EAS project ID, Stripe merchant identifier) to match your app. -
Rebuild the native project (required after adding
google-services.json):
- FCM does not work in Expo Go. Use a dev client or a full build.
- The app creates a notification channel on Android before requesting the token.
Why this file is required
google-services.json is consumed by the Android build tooling to configure
Firebase/FCM. Without it, Android cannot register for a push token and FCM
pushes will fail. This repo ships a placeholder file so you can commit safely,
but you must replace it with the Firebase config for your own app.
Backend Setup (FCM)
FCM requires a Firebase service account (Admin SDK) JSON. Do not usegoogle-services.json.
Required env vars:
FCM_PROJECT_IDFCM_SERVICE_ACCOUNT_BASE64
Sending a Test Push
Use the API guide to create a push token and send a test notification. The API sends via APNs for iOS tokens and FCM for Android tokens. See: API SetupTroubleshooting
If you see:- You rebuilt the Android native project after adding
google-services.json. - You are not running in Expo Go.