Firebase Setup

Firebase powers push notifications (and optional analytics). Without it the app works normally — push simply stays off.

1. Create the project

  1. Go to console.firebase.google.com → Add project (Google Analytics optional).

2. Register your apps

Android: Add app → Android, enter your package name exactly as on the admin Applications page → download google-services.json.

iOS: Add app → iOS, enter your bundle ID → download GoogleService-Info.plist.

3. Server key for sending

Firebase Console → ⚙ Project settings → Service accounts → Generate new private key. A JSON file downloads — this is the secret key your backend uses to send pushes.

4. Upload all three in the admin panel

Admin → Firebase: upload the three files. Each one is validated on upload.

FileUsed byEver leaves your server?
google-services.jsonThe Android appYes — packaged into the export
GoogleService-Info.plistThe iOS appYes — packaged into the export
Service account JSONYour PHP backend onlyNever — stored outside the web root

Then enable Cloud Messaging (and Analytics if wanted) and save.

5. Rebuild the app

Re-download the export and run dart run tool/apply_config.dart — it places the platform files and activates the Google Services Gradle plugin automatically. Rebuild and reinstall the app; it registers its device token on first launch.

iOS extra step

Upload an APNs Auth Key in Firebase (see ios-build.md) — required for pushes to reach iPhones.

Troubleshooting

  • "Firebase Cloud Messaging is not configured" when sending → the service account JSON is missing or Cloud Messaging is disabled.
  • Sends fail with AUTH errors → regenerate the service-account key and re-upload.
  • Android receives, iOS doesn't → missing APNs key (above).