Migrate to Firebase Installation IDs
If you send push notifications through FCM, 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.
If you send push notifications through FCM, Firebase 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 3.12.0 of customerio-expo-plugin, you can turn on the setting with a plugin option, and the Customer.io SDK registers the FID. Until you turn on the setting, the SDK registers FCM tokens instead.
When someone opens a version of 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. To learn how FIDs differ from FCM tokens and how Customer.io sends to each, see Device IDs.
Turn on FID mode
-
Update
customerio-expo-pluginto 3.12.0 or later andcustomerio-reactnativeto 6.14.0 or later. Usefirebase-messaging25.1.2 or later on Android andFirebaseMessaging12.19.0 or later on iOS. On iOS, if you use thefcmprovider with React Native Firebase 26.1 or later, setios.pushNotification.useFirebaseFromApptotrue, which needscustomerio-expo-plugin4.1.0 or later, with thecustomerio-reactnativeversion that plugin release requires (7.1.0 for plugin 4.1.0). See React Native Firebase 26.1 and later. -
Add the
firebaseInstallationIdoption at the top level of your plugin config inapp.jsonorapp.config.js. The plugin turns on Firebase’s FID setting on Android, and on iOS when you use thefcmprovider.JSON{ "plugins": [ [ "customerio-expo-plugin", { "ios": { "pushNotification": { "provider": "fcm" } }, "firebaseInstallationId": { "enabled": true } } ] ] } -
Run
npx expo prebuild. -
If your app calls
CustomerIO.registerDeviceToken(), pass the FID instead of a token from another package, because Firebase doesn’t return an FCM token in FID mode. You can get the FID withgetId()from React Native Firebase’s Installations module.On a fresh iOS install, if you set
ios.pushNotification.autoFetchDeviceTokentofalseand turned off FCM auto-initialization (FirebaseMessagingAutoInitEnabled), neither the SDK nor Firebase registers the FID with FCM. In that case, callMessaging.messaging().register(completion:)in native code before you read the FID.
To go back to FCM tokens, set enabled to false and run npx expo prebuild again.