Packages and Configuration Options

The SDK consists of a few packages. You’ll get the most value out of when you use all our packages together, but this lets you omit packages for features you don’t intend to use.

SDK packages

To minimize our SDK’s impact on your app’s size, we’ve split the SDK into packages. You can limit your install to the packages that you need for your project.

You must install the CioDataPipelines package. It lets you identify people, which you must do before you can send them messages, track their events, etc.

Package ProductRequired?Description
CioDataPipelinesidentify people and track events
CioMessagingPushAPNReceive push notifications over Apple’s Push Notification Service (APNs)
CioMessagingPushFCMReceive push notifications over Google Firebase Cloud Messaging (FCM)
CioMessagingInAppReceive in-app notifications

Installing via CocoaPods

When you install the SDK via CocoaPods, you can find our packages by replacing the Cio in package names with CustomerIO/—e.g. CustomerIO/DataPipelines.

Configuration options

You’ll call configuration options before you initialize the SDK with SDKConfigBuilder. When you initialize the SDK, you can pass configuration options. In most cases, you’ll want to stick with the defaults, but you might do things like change the logLevel when testing updates to your app.

import CioDataPipelines

let config = SDKConfigBuilder(cdpApiKey: "YOUR_CDP_API_KEY") // Mandatory for all customers
            .migrationSiteId("YOUR_SITE_ID") // Mandatory only for migrating customers

cdpApiKeystringRequired: the key you'll use to initialize the SDK and send data to
migrationSiteIdstringRequired if you're updating from 2.x: the credential for previous versions of the SDK. This key is used to send remaining tasks to when your audience updates your app.
region.EU or .US.USRequired if your account is in the EU region. This sets your account region in the format Region.US.
autoTrackDeviceAttributesbooleantrueAutomatically gathers information about devices, like operating system, device locale, model, app version, etc
autoTrackUIKitScreenViewsbooleanfalseFor UIKit-based apps: if true, the SDK automatically sends screen events for every screen your audience visits.
trackApplicationLifecycleEventsbooleantrueSet to false if you don't want the app to send lifecycle events
logLevelstringerrorSets the level of logs you can view from the SDK. Set to debug or info to see more logging output.

visionOS Support

The iOS SDK supports VisionOS. We have a handy sample app that demonstrates how to use the SDK with Vision Pro devices, along with a handy readme, in the Apps/VisionOS directory.

a preview of the visionOS sample app where you can set traits to test your implementation
a preview of the visionOS sample app where you can set traits to test your implementation

We’ve only tested the iOS SDK with visionOS using Swift Package Manager. If you use CocoaPods, everything might work, but we can’t guarantee it.

Also, for now, we only support Apple’s Push Notification Service (APNS) for visionOS. You won’t be able to send push notifications to Vision Pro devices using Firebase Cloud Messaging (FCM).

Copied to clipboard!
Current release
Is this page helpful?
Chat with AI