Android setup
Firebase, development builds and secrets needed before push works.
Remote push does not work in Expo Go on Android, so the app runs as a development build. Firebase needs one-time setup.
Create the Firebase project
In the Firebase console, create a project and add an Android app with the package name com.bartuozel.pocketnotifier (set in app.json; it cannot change after release). Decided
Add google-services.json
Download it and save it as apps/native/google-services.json. It is committed: it is the Firebase client config that ships inside every app build, and its API key is restricted to this app's package, so it is not a secret. The server key in the next step is.
Expo reads it from android.googleServicesFile in the app config.
Create the server key
In Project settings → Service accounts, generate a private key. It becomes the Worker secret FCM_SERVICE_ACCOUNT and is never committed. The secret is already declared as optional and sensitive in apps/server/.env.schema, and packages/infra/alchemy.run.ts passes it to the Worker when it is set.
- Put the JSON, on one line and in single quotes, into the git-ignored
apps/server/.env(or the deploy environment):FCM_SERVICE_ACCOUNT='{"type":"service_account",...}'. With double quotes, the\ns in the key may be expanded; the server copes with that, but single quotes are safer. - Restart the server or deploy again. Without the secret, the server runs with push disabled and logs
push disabled.
Build and install the development build
cd apps/native
pnpm android # expo run:android: local build, needs Android Studio
# or
npx eas-cli build --profile development --platform androidCheck delivery
Sign in, allow notifications, then publish to a project you are subscribed to:
curl -X POST "$NOTIFIER_URL/v1/projects/test/messages" \
-H "Authorization: Bearer $NOTIFIER_TOKEN" -H "Content-Type: application/json" \
-d '{"title":"Hello","body":"From curl","priority":4}'The notification should pop up within seconds, even with the app swiped away.
Troubleshooting
| Symptom | Likely cause |
|---|---|
| No notification, app open or closed | Device not registered; check Settings → Devices |
| Notification only when the app is open | Background receiver not set up; see Receiving on Android |
| Low priority messages arrive late | Expected: priority 1–3 are sent as FCM NORMAL and Android may batch them |
| Nothing after force-stopping the app | Android blocks all delivery to force-stopped apps until they are opened again |