Skip to content

chore: move FCM push registration to Firebase Installation IDs #2256

Backlog

Description

@jvsena42

firebase-messaging 25.1.0+ deprecates token-based registration (getToken, deleteToken, onNewToken) in favor of Firebase Installation ID (FID) registration (register() / unregister(), onRegistered / onUnregistered). The token APIs still work; FID registration is opt-in through the firebase_messaging_installation_id_enabled manifest flag.

#1978 (firebase-bom 35.2.0, firebase-messaging 26.0.2) keeps the token flow and suppresses OVERRIDE_DEPRECATION on FcmService.onNewToken. deleteToken() and firebaseMessaging.token stay deprecation warnings.

Where the token goes

The app passes the FCM token to bitkit-core wakePrepareRegistration(platform = FCM, pushToken = …), which registers it with the wake gateway (synonymdev/wake, wake.bitkit.to / wake.staging.bitkit.to). The gateway sends through FCM HTTP v1 messages:send with message.token (crates/wake-gateway/src/engine/render.rs). Blocktank no longer sends pushes.

Work

  1. wake gateway (synonymdev/wake): target FCM by FID (message.fid, per the FID migration docs; confirm against Firebase's own reference) for FID registrations, and keep token for registrations from app versions that still send tokens. Handle the FID-specific unregistered errors in transport/fcm/classify.rs.
  2. bitkit-core wake module: let a registration say its identifier is an FID (new WakePlatform value or a field), port the change from wake-proto, release bindings.
  3. bitkit-android:
    • Enable firebase_messaging_installation_id_enabled in the manifest.
    • FcmService: replace onNewToken with onRegistered / onUnregistered.
    • WakeRepo.kt:199: replace firebaseMessaging.token.await() with register() and the FID from onRegistered.
    • WipeWalletUseCase.kt:118: replace deleteToken() with unregister().
    • Existing installs re-register on their own, since the registration fingerprint includes the push identifier. Check that the old token registration is removed, not left beside the FID one.
    • Remove the @Suppress("OVERRIDE_DEPRECATION") from chore: bump com.google.firebase:firebase-bom from 34.8.0 to 35.2.0 #1978.

Order: gateway, then core, then app. iOS uses APNs and is not affected.

Rough size: gateway ~1–2 days, core ~1 day plus a release, app ~1–2 days.

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions