Migrate to Firebase Installation IDs
Register Firebase Installation IDs (FIDs) with Customer.io instead of FCM registration tokens. FID mode is optional, and your existing token-based integration keeps working until you choose to migrate.
Firebase Cloud Messaging can register devices with Firebase Installation IDs (FIDs) instead of FCM registration tokens. When you turn on Firebase’s FID setting, your app is in FID mode. Starting in version 4.24.0, the Customer.io Android SDK registers the FID when your app is in FID mode. Until you turn on the setting, the SDK registers FCM tokens instead.
When someone opens your app in FID mode, the SDK replaces the device’s FCM token with the FID on their profile. You don’t need to change anything in Customer.io. See Device IDs to learn how FIDs differ from FCM tokens and how Customer.io supports each kind of ID.
Turn on FID mode
-
Update the Customer.io SDK to 4.24.0 or later, and
firebase-messagingto 25.1.2 or later. -
Turn on Firebase’s FID setting in your
AndroidManifest.xml, inside<application>. See Firebase’s Android setup guide for details.XML<meta-data android:name="firebase_messaging_installation_id_enabled" android:value="true" /> -
If your app has its own
FirebaseMessagingService, forwardonRegisteredto Customer.io instead ofonNewToken. Firebase calls onlyonRegisteredin FID mode.KOTLINoverride fun onRegistered(installationId: String) { CustomerIOFirebaseMessagingService.onRegistered(this, installationId) } -
If your app calls
CustomerIO.instance().registerDeviceToken(), pass the FID fromFirebaseInstallations.getInstance().idinstead of an FCM token. Firebase doesn’t return an FCM token in FID mode.Reading the FID doesn’t register it with FCM, and FCM can’t deliver to the FID until Firebase registers the app. Firebase registers the app at startup by default. If you turned off FCM auto-initialization, call
FirebaseMessaging.getInstance().register()first, and read the FID after it completes.
To go back to FCM tokens, remove the meta-data element and forward onNewToken again.