Firebase and FCM
Firebase Cloud Messaging is optional. Without google-services.json / GoogleService-Info.plist, Field still runs (NullFieldPushClient).
FCM is not the sync engine. FCM can show a notification and, when the app is opened/resumed, request a sync. It does not perform data synchronization. Drift + outbox remain the authority path.
Use your Firebase project. Never Cnone-Tech credentials. Do not paste real apiKey values into this documentation.
android/app/google-services.json ← your projectios/Runner/GoogleService-Info.plistOS notification permission is requested after session, not on the login screen. See Notifications.
Push vs sync
Section titled “Push vs sync”| Field data sync | Firebase notification | |
|---|---|---|
| Required to log in | Yes (your Veldriq origin) | No |
| Writes the job database on the phone | Yes (outbox + pull) | No — payload never writes local jobs |
| Works without google-services.json / plist | Yes | No notifications |
| While the app is killed | Does not run | OS may still show a banner; tap to open |
After a tap, the app restores the session, may run the same coordinator as Sync now, then opens the job if it is in the local cache. Missing cache: This job is not available offline. Wrong workspace: This notification is for another workspace. Switch workspace to open it. The payload does not switch tenants.
Events this product sends
Section titled “Events this product sends”Only these four, from Veldriq Web after the business change is committed. If Firebase is down, the assignment still exists — the technician gets it on the next pull / Sync now.
| Event | Who |
|---|---|
| Assignment created | Assigned technician |
| Assignment removed | Previous technician |
| Appointment rescheduled | Assigned technician |
| Appointment cancelled | Assigned technician |
Reassign A→B is removed for A plus created for B. There is no generic “reassigned” type.
Android
Section titled “Android”- Create or select your Firebase project.
- Register an Android app whose package name matches the final
applicationIdyou ship. - Default if
buyer.propertiesis absent:com.cnonetech.veldriq.field. Flavordevelopmentadds.dev. Register both apps if you use both flavors. - Download
google-services.jsonand place it exactly atandroid/app/google-services.json. The Google Services Gradle plugin applies only if that file exists. - Rebuild the flavor you registered. Uninstall previous builds if the applicationId changed.
If it fails: Gradle / Firebase No matching client found usually means package_name in the JSON ≠ the applicationId of this flavor (including the .dev suffix). Register the matching Android app and replace the JSON. Do not test push as proof of sync on an emulator; validate on a device when possible.
Do not commit this file to a public tree. It is gitignored. Server credentials stay on the web product, not in Flutter.
- Register an iOS app whose bundle id matches
PRODUCT_BUNDLE_IDENTIFIER(templatecom.cnonetech.veldriq.field). - Place
GoogleService-Info.plistatios/Runner/GoogleService-Info.plist. - Upload an APNs key to the Firebase project. Without APNs, FCM cannot wake iPhones.
- Keep the existing
aps-environmententitlement. Do not addUIBackgroundModes(no background fetch, location, or remote-notification mode). - Verify on a physical iPhone. The Simulator is not a substitute.
Enablement order
Section titled “Enablement order”- Native files on the binary (JSON and/or plist).
- Firebase service account on the web product. Queue worker running. Never put that JSON in this Flutter tree.
- Technician: login → workspace → Field session → OS permission (once) → token →
PUT /api/v1/field/installations. - Office assigns a job. Confirm a notification, then confirm Sync still has the job via pull even if you ignore the banner.
Missing native files: Firebase init fails closed; the app continues without push. Logout tries DELETE /api/v1/field/installations first; a network failure does not block logout.
There is no background message handler in this client. Revoking push does not wipe local work.