Loading…

Multiple push providers

Updated

By default, our Expo plugin expects to be the only push package in your project. It’ll automatically handle push notification metrics and fetch a device tokens for you. But if you use our SDK with other push packages like react-native-firebase, you may want to make a couple of configuration changes.

Use React Native Firebase with the Customer.io SDK

If you use react-native-firebase with the Customer.io SDK, you’ll need to make sure that your app.json or app.config.js file doesn’t include the ios.pushNotification.googleServicesFile option.

This ensures that you properly capture metrics for push notifications sent through Customer.io and any notifications you receive using react-native-firebase.

{
   "expo": {
        "ios": {
            // include plist file here
            "googleServicesFile": "./GoogleService-Info.plist"
        },
        "plugins": [
            [
                "customerio-expo-plugin",
                {
                    "android": {
                        "googleServicesFile": "./files/google-services.json"
                    },
                    "ios": {
                        "pushNotification": {
                            "provider": "fcm", 
                            // don't include your plist file here
                        }
                    }
                }
            ]
        ]
    }
}

Capture push tokens from another push provider

If you use another push package like expo-notifications, and you want to utilize that package to get device tokens, you’ll need to update your app.json or app.config.js file to disable automatic device token fetching and make sure you register push tokens with Customer.io using the CustomerIO.registerDeviceToken(<token>) method.

  1. In your app.json or app.config.js file, set the ios.pushNotification.autoFetchDeviceToken option to false.

    {
       "plugins": [
          [
             "customerio-expo-plugin",
             {
                "ios": {
                   "pushNotification": {
                      "autoFetchDeviceToken": false
                   }
                }
             }
          ]
       ]
    }

  2. Capture push tokens from the other provider and register them with our SDK using the CustomerIO.registerDeviceToken(<token>) method.

Copied to clipboard!
  Contents
Current release
 2.0.0-beta.2
Is this page helpful?