Skip to content
Cnone-Tech Documentation

Firebase and FCM

Cnone-Tech DocsVeldriq Field

Veldriq Field

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 project
ios/Runner/GoogleService-Info.plist

OS notification permission is requested after session, not on the login screen. See Notifications.

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.

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.

  1. Create or select your Firebase project.
  2. Register an Android app whose package name matches the final applicationId you ship.
  3. Default if buyer.properties is absent: com.cnonetech.veldriq.field. Flavor development adds .dev. Register both apps if you use both flavors.
  4. Download google-services.json and place it exactly at android/app/google-services.json. The Google Services Gradle plugin applies only if that file exists.
  5. 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.

  1. Register an iOS app whose bundle id matches PRODUCT_BUNDLE_IDENTIFIER (template com.cnonetech.veldriq.field).
  2. Place GoogleService-Info.plist at ios/Runner/GoogleService-Info.plist.
  3. Upload an APNs key to the Firebase project. Without APNs, FCM cannot wake iPhones.
  4. Keep the existing aps-environment entitlement. Do not add UIBackgroundModes (no background fetch, location, or remote-notification mode).
  5. Verify on a physical iPhone. The Simulator is not a substitute.
  1. Native files on the binary (JSON and/or plist).
  2. Firebase service account on the web product. Queue worker running. Never put that JSON in this Flutter tree.
  3. Technician: login → workspace → Field session → OS permission (once) → token → PUT /api/v1/field/installations.
  4. 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.