Migrate to Firebase Installation IDs
If you send iOS 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 4.11.0, the Customer.io iOS 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 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 the Customer.io iOS SDK to 4.11.0 or later,
CioFirebaseWrapperto 1.1.0 or later, andFirebaseMessagingto 12.19.0 or later. -
Turn on Firebase’s FID setting in your app’s
Info.plist. See Firebase’s Apple setup guide for details.XML<key>FirebaseMessagingInstallationIdEnabled</key> <true/> -
If you set
autoFetchDeviceToken(false)and forward Firebase’sMessagingDelegatecallbacks to Customer.io yourself, forwardmessaging(_:didReceiveRegistration:)instead ofmessaging(_:didReceiveRegistrationToken:). Firebase calls onlydidReceiveRegistrationin FID mode.SWIFTfunc messaging(_ messaging: Messaging, didReceiveRegistration installationId: String?) { MessagingPush.shared.messaging(messaging, didReceiveRegistration: installationId) } -
If your app calls
MessagingPush.shared.registerDeviceToken(fcmToken:), pass the FID fromInstallations.installations().installationID()instead of an FCM token, because 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
Messaging.messaging().register(completion:)first, and read the FID after it completes.
To go back to FCM tokens, remove the Info.plist key and forward didReceiveRegistrationToken again.