![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
customerio-expo-plugin
Advanced tools
Power automated communication that people like to receive.
This is the official Customer.io Expo plugin, supporting mobile apps.
You'll find our complete SDK documentation at https://customer.io/docs/sdk/expo. This readme only contains basic information to help you install the plugin and handle the pre-build.
The Expo plugin takes advantage of our React Native SDK, and requires very little setup. It extends the Expo config to let you customize the prebuild phase of managed workflow builds, which means you don't need to eject to a bare workflow.
After you add the plugin to your project, you'll need to install our React Native SDK and run prebuild. The plugin automatically generates and configures the necessary native code files required to make our React Native SDK to work on your project. We've tested with Expo SDK versions 45
and 46
, Using eas
build with EAS managed credentials and a limited set of Android and iOS versions.
By default, the plugin expects to use Apple's Push Notification service (APNs) for iOS and Firebase Cloud Messaging (FCM) for Android. We plan to add FCM support for iOS in a future release.
Run an installation command:
expo install customerio-expo-plugin
npm install customerio-expo-plugin
yarn add customerio-expo-plugin
Add customerio-expo-plugin
plugin in your app.json
or app.config.js
and set configuration options. In most cases, you'll want to stick to our default options. When you configure the plugin, you can pass options. In most cases, you'll want to stick with the defaults, which enables all the SDK features. However you might want to disable rich push for iOS
.
// app.json
{
...
"plugins": [
...
[
"customerio-expo-plugin",
{
"android": {
"googleServicesFilePath": "files/"
},
"ios": {
"pushNotification": {
"useRichPush": true
}
}
}
]
]
}
Set the iOS build target. Our React Native SDK requires iOS deployment target 13
. You can install expo-build-properties
and add the following to app.json
or app.plugin.js
to set your build target.
{
...
"plugins": [
...
[
"expo-build-properties",
{
"ios": {
"deploymentTarget": "13.0"
}
}
]
]
}
ios/{your_appname}.xcworkspace
in XCode.{your_appname}
and click Add files to "{your_appname}".{your_appname}/PushNotification.swift
and click Add.Add an import statement to your project for the react native library. We haven't included it below, but you can import CioLogLevel
to set log outputs to something other than error
; this may help you debug your application.
import { CustomerIO, CustomerioConfig, CustomerIOEnv, Region } from ‘customerio-reactnative’;
In useEffect
, initialize the package with your CustomerioConfig
options and CustomerIOEnv
variables. You can find your Site ID and API Key credentials—or create new ones—under Data & Integrations > Integrations > Customer.io API:
useEffect(() => {
const data = new CustomerioConfig()
data.logLevel = CioLogLevel.debug
const env = new CustomerIOEnv()
env.siteId = Env.siteId
env.apiKey = Env.apiKey
env.organizationId = Env.organizationId
//organizationId is used to send in-app messages.
env.region = Region.US
//Region is optional, defaults to Region.US. Use Region.EU for EU-based workspaces.
CustomerIO.initialize(env, data)
}, [])
The customerio-expo-plugin
supports the following configuration options. In most cases, you'll want to use the default options shown in the installation instructions.
Option | Type | Default | Description |
android | object | undefined | Required if you want to setup Android even if it is empty. Eg ("android": {} ). |
ios | object | undefined | Required if you want to setup iOS even if it is empty. Eg ("ios": {} ). |
android.googleServicesFilePath | string | undefined | Set the path to the folder that contains your google-services.json file with a trailing slash (/ ). |
ios.pushNotification | object | undefined | Enables push notifications for iOS, even if it is an empty object |
ios.pushNotification.useRichPush | boolean | false | Enables rich push for iOS |
After you install and configure the plugin, run the prebuild.
# Run prebuild
expo prebuild
# Delete ios and android folders before prebuild
expo prebuild --clean
Now your project is ready to use the React Native SDK.
For now, you'll need to add a short workaround to take advantage of rich push features. Add the following to ios/NotificationService/NotificationService.swift
after you run prebuild --clean
.
...
import CioTracking // <== Add import
@objc
public class NotificationServiceCioManager : NSObject {
public override init() {}
@objc(didReceive:withContentHandler:)
public func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
CustomerIO.initialize(siteId: "<YourSiteId>", apiKey: "<YourApiKey>", region: Region.US) // <== Workaround code
...
See our complete SDK documentation at https://customer.io/docs/sdk/expo/
Thanks for taking an interest in our project! We welcome your contributions.
We value an open, welcoming, diverse, inclusive, and healthy community for this project. We expect all contributors to follow our code of conduct.
FAQs
Expo config plugin for the Customer IO React Native SDK
The npm package customerio-expo-plugin receives a total of 1,317 weekly downloads. As such, customerio-expo-plugin popularity was classified as popular.
We found that customerio-expo-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.