# iOS SDK Documentation

Generated on: 11/17/2026

This documentation bundle contains the complete iOS SDK documentation for use with LLMs and offline reference.

---

## Quick start guide

**Source:** /integrations/sdk/ios/quick-start-guide

# Quick start guide

This guide contains the minimum steps you'll need to follow to install and start using the Customer.io SDK in your iOS app.

Set up your integration with an AI agent

Connect your AI coding agent to Customer.io’s [MCP](/ai/mcp/get-started/) or the [CLI](/ai/cli/get-started/#setup-cli). When you add this integration in the Customer.io UI, you’ll see a prompt under **Set up with an agent** that you can pass to your coding agent. With the Customer.io MCP or CLI tools, these prompts can help you set up your integration with minimal effort.

## Setup process overview

Our SDK lets you build native mobile apps for iOS. When you’re done, you’ll be able to `identify` people, `track` their activity, and send both push notifications and in-app messages.

1.  [Install and initialize the SDK](#1-install-and-initialize-the-sdk)
2.  [Identify and Track](#2-identify-and-track)
3.  [Add push notification support](#3-add-push-notification-support)
4.  [Add in-app messaging support](#4-add-in-app-messaging-support)

## 1\. Install and initialize the SDK

1.  Add a [new *iOS* connection in Customer.io](https://fly.customer.io/workspaces/last/journeys/integrations/all/overview) to get your CDP API key. See [Get your CDP API key](/integrations/sdk/ios/getting-started/auth/#get-your-cdp-api-key) for details. You’ll use this API key to initialize the SDK.
    
2.  Install the SDK. We typically recommend that you install the SDK using Swift Package Manager (SPM). But if your app uses CocoaPods, you can install our pods. The SDK supports iOS 15 and later, so your app’s minimum deployment target must be iOS 15.0 or later.
    
    Swift Package Manager (SPM)CocoaPods
    
    #### Swift Package Manager (SPM)
    
    1.  Follow **[Apple’s instructions ↗](https://developer.apple.com/documentation/swift_packages/adding_package_dependencies_to_your_app)** to add `https://github.com/customerio/customerio-ios.git` as a dependency to your project in Xcode and select all the packages you need. If you send push notifications using Firebase Cloud Messaging (FCM), select both `MessagingPushFCM` and `CioFirebaseWrapper`.
        
    2.  If you use FCM, your app also needs Firebase’s `FirebaseMessaging` package, version 8.7.0 or later. The Customer.io package doesn’t include Firebase. If your app doesn’t have it yet, add `https://github.com/firebase/firebase-ios-sdk` as a dependency and select `FirebaseMessaging`.
        
    3.  Set the *Dependency Rule* to *Up to Next Major Version*. While we encourage you to keep your app up to date with the latest SDK, major versions can include breaking changes or new features that require your attention.
        
         ![select up to next major version when installing the sdk](https://customer.io/images/xcode-install-sdk.png)
        
    
    #### CocoaPods
    
    Add the pods to your Podfile:
    
    ```
       platform :ios, '15.0'
    
       pod 'CustomerIO/DataPipelines'  # Required
       pod 'CustomerIO/MessagingPushAPN'  # Optional, for APNs
       pod 'CustomerIO/MessagingPushFCM'  # Optional, for FCM
       pod 'CioFirebaseWrapper'  # Required for FCM (a standalone pod, no CustomerIO/ prefix)
       pod 'CustomerIO/MessagingInApp'  # Optional, for in-app messaging
       pod 'CustomerIO/Location'  # Optional, for device location tracking
       pod 'CustomerIO/LocationGeofence'  # Optional, for geofencing (requires Location)
    ```
    
    The `CioFirebaseWrapper` pod also installs `FirebaseMessaging`. If your app gets Firebase another way, like through Swift Package Manager, use `pod 'CioFirebaseWrapper/Core'` instead. It installs `CioFirebaseWrapper` without Firebase.
    
3.  Import the appropriate packages. We’re importing all our packages, but you can modify this list if you don’t intend to use all Customer.io features. If you send notifications using Firebase Cloud Messaging (FCM), import the `CioMessagingPushFCM` and `CioFirebaseWrapper` package rather than `CioMessagingPushAPN`.
    
    UIKit with SwiftUIKit with Objective-CSwiftUI
    
    #### UIKit with Swift
    
    ```
     import CioDataPipelines
     import CioMessagingInApp
     import CioMessagingPushAPN
     import UIKit
    ```
    
    #### UIKit with Objective-C
    
    ```
     @import UIKit;
     @import CioDataPipelines;
     @import CioMessagingInApp;
     @import CioMessagingPushAPN;
    ```
    
    #### SwiftUI
    
    ```
     import SwiftUI
     import CioDataPipelines
     import CioMessagingInApp
     import CioMessagingPushAPN
    ```
    
4.  Initialize the SDK. You’ll usually do this in the `AppDelegate application(_ application: didFinishLaunchingWithOptions)` function, and you’ll use the `CioAppDelegateWrapper` to handle push notifications and device token registration and initialize the SDK. You also need the **CDP API Key** that you obtained when you added your iOS integration to your workspace.
    
    UIKit with SwiftUIKit with Objective-CSwiftUI
    
    #### UIKit with Swift
    
    ```
    @main
    class AppDelegateWithCioIntegration: CioAppDelegateWrapper<AppDelegate> {}
    
     class AppDelegate: UIResponder, UIApplicationDelegate {
         func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
             // Override point for customization after application launch.
    
             // Initialize the Customer.io SDK 
             let cdpApiKey = "YOUR_CDP_API_KEY"
             let siteId = "YOUR_SITE_ID"
             let config = SDKConfigBuilder(cdpApiKey: cdpApiKey)
                 // If your account is in the EU region, uncomment the next line
                 // .region(.EU)
                 .migrationSiteId(siteId) // only required if you used version 2.x or earlier
                 .autoTrackUIKitScreenViews() // Set auto tracking of UIKit screen views
                 .logLevel(CioLogLevel.debug) // Add this to troubleshoot issues - disable debug in production
             CustomerIO.initialize(withConfig: config.build())
    
             return true
         }
     }
    ```
    
    #### UIKit with Objective-C
    
    ```
    @interface AppDelegate : UIResponder <UIApplicationDelegate>
    @property (strong, nonatomic) UIWindow *window;
    @end
    
    // AppDelegate.m
    #import "AppDelegate.h"
    
    @implementation AppDelegate
    
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        // Initialize the Customer.io SDK
        NSString *cdpApiKey = @"YOUR_CDP_API_KEY";
        NSString *siteId = @"YOUR_SITE_ID";
    
        CioSDKConfigBuilder *config = [[CioSDKConfigBuilder alloc] initWithCdpApiKey:cdpApiKey];
        // If your account is in the EU region, uncomment the next line
        // [config region:CioRegionEU];
        [config migrationSiteId:siteId]; // only required if you used version 2.x or earlier
        [config autoTrackUIKitScreenViews]; // Set auto tracking of UIKit screen views
        [config logLevel:CioLogLevelDebug]; // Add this to troubleshoot issues - disable debug in production
    
        [CustomerIO initializeWithConfig:[config build]];
    
        return YES;
    }
    
    @end
    ```
    
    #### SwiftUI
    
    ```
    @main
    struct MainApp: App {
        @UIApplicationDelegateAdaptor(CioAppDelegateWrapper<AppDelegate>.self) private var appDelegate
    
        var body: some Scene {
            WindowGroup {
                ContentView()
            }
        }
    }
    
    class AppDelegate: UIResponder, UIApplicationDelegate {
        func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
            // Initialize the Customer.io SDK 
            let cdpApiKey = "YOUR_CDP_API_KEY"
            let siteId = "YOUR_SITE_ID"
            let config = SDKConfigBuilder(cdpApiKey: cdpApiKey)
                // If your account is in the EU region, uncomment the next line
                // .region(.EU)
                .migrationSiteId(siteId) // only required for migration
                .autoTrackUIKitScreenViews() // Set auto tracking of UIKit screen views
                .logLevel(CioLogLevel.debug) // Add this to troubleshoot issues - disable debug in production
            CustomerIO.initialize(withConfig: config.build())
    
            return true
        }
    }
    ```
    

Also track location and geofences

Want to react when someone enters or leaves a real-world place—a store, a venue, a neighborhood? The SDK’s Location and Geofence modules do that. They need location permissions and a little extra setup, so they aren’t part of the steps above. See [geofencing](/integrations/sdk/ios/tracking/geofencing/) to get started, or the [packages and configuration reference](/integrations/sdk/ios/getting-started/packages-options/) for every option.

## 2\. Identify and Track Users

1.  Identify a user in your app using the CustomerIO.identify method. You must identify a user before you can send push notifications and personalized in-app messages.
    
    SwiftObjective-C
    
    #### Swift
    
    ```
    // Identify a user with just a user ID
    CustomerIO.shared.identify(userId: "user@example.com")
    
    // Identify a user with additional attributes
    CustomerIO.shared.identify(
     userId: "user@example.com", 
     traits: [
         "email": "user@example.com",
         "first_name": "John",
         "last_name": "Doe",
         "plan_name": "Premium",
         "device_type": "iOS"
     ]
    )
    
    // clear the user identity when they log out
    CustomerIO.shared.clearIdentify()
    ```
    
    #### Objective-C
    
    ```
    // Identify a user with just a user ID
    [CustomerIO identifyUserWithId:@"user@example.com"];
    
    // Identify a user with additional attributes
    [CustomerIO identifyUserWithId:@"user@example.com" traits:@{
         @"email": @"user@example.com",
         @"first_name": @"John",
         @"last_name": @"Doe",
         @"plan_name": @"Premium",
         @"device_type": @"iOS"
    }];
    
    // clear the user identity when they log out
    [CustomerIO clearIdentify];
    ```
    
2.  Track a custom activity using the CustomerIO.track method. Events help you trigger personalized automations and record user behavior in your app.
    
    SwiftObjective-C
    
    #### Swift
    
    ```
    // Track a simple event without properties
    CustomerIO.shared.track(name: "checkout_started")
    
    // Track an event with properties
    CustomerIO.shared.track(
         name: "product_viewed",
         properties: [
             "product_id": "SKU-123",
             "product_name": "Premium Widget",
             "price": 99.99,
             "currency": "USD",
             "category": "Electronics"
         ]
    )
    ```
    
    #### Objective-C
    
    ```
    // Track a simple event without properties
    [CustomerIO trackEventWithName:@"checkout_started"];
    
    // Track an event with properties
    [CustomerIO trackEventWithName:@"product_viewed" properties:@{
         @"product_id": @"SKU-123",
         @"product_name": @"Premium Widget",
         @"price": @99.99,
         @"currency": @"USD",
         @"category": @"Electronics"
    }];
    ```
    

## 3\. Add push notification support

In your AppDelegate, after your `CustomerIO.initialize` call, add the `MessagingPushAPN.initialize` call. Our push package has its own settings so you can configure push behaviors.

These instructions are for Apple’s Push Notification service (APNs). If you send push notifications using Firebase Cloud Messaging (FCM), see our [push notification instructions](/integrations/sdk/ios/push/push-setup/).

SwiftObjective-C

#### Swift

```
    // Initialize the push package    
    MessagingPushAPN.initialize(
        withConfig: MessagingPushConfigBuilder()
            .autoFetchDeviceToken(true)    // Automatically fetch device token and upload to CustomerIO
            .autoTrackPushEvents(true)     // Automatically track push metrics
            .showPushAppInForeground(true) // Enable Notifications in the foreground
            .build()
    )
    
    // Request permission to show notifications
    UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in
        // Process user response here
    }
```

#### Objective-C

```
// Initialize the push package
[MessagingPushAPN initializeWithConfig:[[MessagingPushConfigBuilder new]
    autoFetchDeviceToken:YES    // Automatically fetch device token and upload to CustomerIO
    autoTrackPushEvents:YES     // Automatically track push metrics
    showPushAppInForeground:YES // Enable Notifications in the foreground
    build]];

// Request permission to show notifications
[[UNUserNotificationCenter currentNotificationCenter] 
    requestAuthorizationWithOptions:(UNAuthorizationOptionAlert | UNAuthorizationOptionSound | UNAuthorizationOptionBadge) 
    completionHandler:^(BOOL granted, NSError * _Nullable error) {
        // Process user response here
    }];
```

Then [add a Notification Service Extension (NSE)](/integrations/sdk/ios/push/push-setup/#notification-service-extension) to your app. Your app needs the NSE to report *Delivered* metrics for iOS push notifications. Without it, your iOS messages don’t report *Delivered*, even when people receive them, unless you [report delivery yourself](/integrations/sdk/ios/push/push-metrics/#metrics-direct).

## 4\. Add in-app messaging support

In your AppDelegate, after your `CustomerIO.initialize` call, add the `MessagingInApp.initialize` call.

Within the call, you’ll need a **Site ID**, which you can get [from your workspace settings](https://fly.customer.io/workspaces/last/settings/api_credentials). This tells the SDK which workspace your in-app messages come from.

SwiftObjective-C

#### Swift

```
// Initialize the in-app package
// Before iOS SDK 4.12.0, use MessagingInAppConfigBuilder(siteId: siteId, region: .US), and use .EU if your account is in our EU data center.
MessagingInApp
    .initialize(withConfig: MessagingInAppConfigBuilder(siteId: siteId).build())
```

#### Objective-C

```
// Initialize the in-app package
[MessagingInApp initializeWithConfig:[[MessagingInAppConfigBuilder alloc] initWithSiteId:siteId region:CioRegionUS]];
```

---

## Getting started > Auth

**Source:** /integrations/sdk/ios/getting-started/auth

# Authentication

To use the SDK, you need a public API key (beginning with `pk_`) to send data to Customer.io. If you upgrade from an earlier SDK version, or use in-app messaging with an SDK version before 5.1.0, you also need your *Site ID*.

To get your SDK keys and send data to the right places, set up a data in integration in Customer.io to represent your app.

**If you haven’t already set up your app as an integration in Customer.io, [set up your integration first](#set-up-a-new-source).**

Which key goes in your app

Your app uses a public key, which starts with `pk_`. Public keys are safe to include in your app. Private keys start with `sk_` and have much broader access to your workspace, so keep them in your backend systems where your users can’t get to them. See [public and private keys](/accounts/settings/managing-credentials/#public-and-private-keys).

## Credentials you’ll need

1.  **Public API key**: This key starts with `pk_` and is shown in code samples as `cdpApiKey`. It lets your app send data to Customer.io, and you need it to initialize the SDK. Customer.io creates one when you set up your integration. You can also create one for an existing integration on the [API Credentials page](/accounts/settings/managing-credentials/#public-and-private-keys).
2.  **Site ID**: If you’re upgrading from version 2.x or earlier, you set your previous Site ID as the `migrationSiteId`. In SDK versions before 5.1.0, you also need it to initialize the `CioMessagingInApp` package. In 5.1.0 and later, the SDK uses your public key for in-app messages instead.

## Set up a new iOS integration in Customer.io

If you don’t already have a public key, set up a new data in integration in Customer.io. The integration represents your app and the stream of data that you send to Customer.io.

1.  Go to *Integrations* and click **Add integration**.
    
2.  Select **iOS**.
    
     ![set up your iOS source](https://customer.io/images/cdp-ios-source.png)
    
3.  Enter a *Name* for your integration, like “My iOS App”.
    
4.  Click the **Copy and paste code** tab. Customer.io shows a code sample with the credentials you need. The sample includes `cdpApiKey`, your public key, which initializes the SDK and sends data to Customer.io. If you use in-app messaging, it also includes `siteId`, which initializes `CioMessagingInApp`.
    
     ![The integration setup screen, with a name for your integration and a code sample that includes your public key](https://customer.io/images/cdp-ios-source-setup.png)
    
    Copy the code—or at least the `cdpApiKey`—into your app. If you use in-app messaging with an SDK version before 5.1.0, copy the `siteId` too.
    
    ```
    CustomerIO.initialize(
     withConfig: SDKConfigBuilder(cdpApiKey: "YOUR_CDP_API_KEY")
         .region(.US)
         .build()
    )
    // Before iOS SDK 4.12.0, use MessagingInAppConfigBuilder(siteId: "YOUR_SITE_ID", region: .US), and use .EU if your account is in our EU data center.
    MessagingInApp.initialize(
     withConfig: MessagingInAppConfigBuilder(siteId: "YOUR_SITE_ID")
         .build()
    )
    ```
    
5.  Click **Test connection** to check that Customer.io receives data from your app, and then click **Complete setup**. If you aren’t ready to test your app yet, click **Save for later**.
    

## Get credentials from an existing iOS integration

Use this section if you’ve already set up an iOS integration and need to copy your credentials again.

### Get your public key

Use your public key to initialize the SDK and send data to Customer.io. You can find this key on your mobile app’s integration card in Customer.io, or under **Account Settings** > **API Credentials**.

1.  Go to *Integrations*.
2.  Select your iOS integration in the *Overview* tab. If you don’t see an iOS integration, you’ll need to [set it up](#set-up-a-new-source).
    
     ![the connections page, showing an ios source connected to a journeys destination](https://customer.io/images/cdp-ios-connected-destination.png)
    
3.  Go to **Settings** and find your public key. It starts with `pk_`. Copy this key into your initialization call.
    
     ![The API keys section of your integration's Settings tab, showing your public key](https://customer.io/images/cdp-ios-source-api-key.png)
    
    ```
     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
         ...
    
         let config = SDKConfigBuilder(cdpApiKey: "YOUR_CDP_API_KEY")
             .autoTrackDeviceAttributes(true)
    
         CustomerIO.initialize(withConfig: config.build())
     }
    ```
    

### Find your Site ID manually

You only need your Site ID if you use in-app messaging with an SDK version before 5.1.0, or if you’re setting `migrationSiteId` while upgrading from version 2.x or earlier.

1.  Go to and select **Workspace Settings** in the upper-right corner of the Customer.io app. Then go to [**API and Webhook Credentials**](https://fly.customer.io/workspaces/last/settings/api_credentials).
    
2.  Copy the **Site ID** for the set of credentials that you want to send your in-app messages from. If you don’t have a set of credentials, click **Create Tracking API Key**.
    
     ![find your site ID](https://customer.io/images/cdp-js-site-id.png)
    

In SDK versions before 5.1.0, use this value in `MessagingInAppConfigBuilder(siteId: "YOUR_SITE_ID")`. Before 4.12.0, also pass `region: .US`, or `region: .EU` if your account is in our EU data center. In 5.1.0 and later, the SDK uses your public key, so you can use `MessagingInAppConfigBuilder()` instead. If you’re upgrading from version 2.x or earlier, use the Site ID from your previous SDK setup as `migrationSiteId`.

## Securing your credentials

To simplify things, code samples in our documentation sometimes show API keys directly in your code. But you don’t have to hard-code your keys in your app. You can use environment variables, management tools that handle secrets, or other methods to keep your keys secure if you’re concerned about security.

To be clear, the keys that you’ll use to initialize the SDK don’t provide read access to data in Customer.io; they only write data to Customer.io. A bad actor who found your credentials can’t use your keys to read data from our servers.

---

## Getting started > How it works

**Source:** /integrations/sdk/ios/getting-started/how-it-works

# How it works

Before you can take advantage of our SDK, you need to install the module(s) you want to use, initialize the SDK, and understand the order of operations.

Our SDKs provide a ready-made integration to identify people who use mobile devices and send them notifications. Before you start using the SDK, you should understand a bit about how the SDK works with Customer.io.

Before a person logs into your app, any activity they perform is associated with an anonymous person in Customer.io. In this state, you can track their activity, but you can’t send them messages through Customer.io.

When someone logs into your app, you’ll send an `identify` call to Customer.io. This makes the person eligible to receive messages and reconciles their anonymous activity to the person in Customer.io.

You send messages to a person through the Customer.io automation builder, broadcasts, etc. These messages are not stored on the device side. If you want to send an event-triggered automation to a mobile device, the mobile device user must be identified and have a connection such that it can send an event back to Customer.io and receive a message payload.

## Your app is a data source and Customer.io is a destination

Our iOS SDK is a data in in Customer.io. You can route data from your app to both Customer.io *and* other destinations. This makes it easier to use your app as a part of your larger data stack without relying on extra services or code.

When you set up your integration in Customer.io, you’ll determine where you want to route your data to—your workspace *and* destinations outside of Customer.io.

## Minimum support requirements

To support the Customer.io SDK, you must:

*   Set iOS 15 or later as your minimum deployment target in XCode.
*   Have an iOS 15+ device or Simulator to test your implementation. Remote sandbox APNs delivery requires an iOS 16+ Simulator on macOS 13+ running on Apple silicon or an Apple T2 Security Chip. Use a physical device for production APNs and device-specific behavior.

## Objective-C support

Our SDK is written in Swift and tested in a Swift environment.

Our iOS SDK may work in Objective-C-based projects, but we haven’t tested it that way. If you use our SDK in an Objective-C project and run into trouble, please [let us know](/support/).

## The Processing Queue

The SDK automatically adds all calls to a queue system, and waits to perform these calls until certain criteria is met. This queue makes things easier, both for you and your users: it handles errors and retries for you (even when users lose connectivity), and it can save users’ battery life by batching requests.

The queue holds requests until any one of the following criteria is met:

*   There are 20 or more tasks in the queue.
*   30 seconds have passed since the SDK performed its last task.
*   The app is closed and re-opened.

For example, when you identify a new person in your app using the SDK, you won’t see the created/updated person immediately. You’ll have to wait for the SDK to meet any of the criteria above before the SDK sends a request to the Customer.io API. Then, if the request is successful, you’ll see your created/updated person in your workspace.

---

## Getting started > Packages options

**Source:** /integrations/sdk/ios/getting-started/packages-options

# Packages and configuration options

The SDK consists of a few packages. You'll get the most value out of Customer.io 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 Product

Required?

Description

CioDataPipelines

Yes

`identify` people and `track` events

CioMessagingPushAPN

No

Receive push notifications over Apple’s Push Notification Service (APNs)

CioMessagingPushFCM

No

Receive push notifications over Google Firebase Cloud Messaging (FCM)

CioFirebaseWrapper

No

Required for FCM push notifications. Provides Firebase Cloud Messaging integration

CioMessagingInApp

No

Receive in-app notifications

CioLocation

No

[Enrich user people with accurate device location](/integrations/sdk/ios/tracking/location/)

CioLocationGeofence

No

[Monitor geofences and send location-based events](/integrations/sdk/ios/tracking/geofencing/). Requires CioLocation

### Configuration options

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`. For FCM push notifications, you’ll need both `CustomerIO/MessagingPushFCM` and `CioFirebaseWrapper`.

## 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
            .autoTrackDeviceAttributes(true)
            .region(.EU) 

CustomerIO.initialize(withConfig: config.build()) 
```

Option

Type

Default

Description

`cdpApiKey`

string

**Required**: the key you’ll use to initialize the SDK and send data to Customer.io

`region`

`.EU` or `.US`

`.US`

**Required if your account is in the EU region**. This sets your account region in the format `Region.US`.

`apiHost`

string

The domain you’ll proxy requests through. You’ll only need to set this (and `cdnHost`) if you’re [proxying requests](#proxying-requests).

`autoTrackDeviceAttributes`

boolean

`true`

Automatically gathers information about devices, like operating system, device locale, model, app version, etc

`autoTrackUIKitScreenViews`

boolean

`false`

**For UIKit-based apps**: if true, the SDK automatically sends `screen` events for every screen your audience visits.

`cdnHost`

string

The domain you’ll fetch configuration settings from. You’ll only need to set this (and `apiHost`) if you’re [proxying requests](#proxying-requests).

`logLevel`

string

`error`

Sets the level of logs you can view from the SDK. Set to `debug` or `info` to see more logging output.

`migrationSiteId`

string

**Required if you’re updating from 2.x**: the credential for previous versions of the SDK. This key is used to send remaining tasks to Customer.io when your audience updates your app.

`screenViewUse`

`.all` or `.inApp`

`all`

`screenView: .all` (Default): Screen events are sent to Customer.io. You can use these events to build segments, trigger automations, and target in-app messages.  
  
`screenView: inApp`: Screen view events not sent to Customer.io. You’ll *only* use them to target in-app messages based on page rules.

`trackApplicationLifecycleEvents`

boolean

`true`

Set to `false` if you don’t want the app to send lifecycle events

## Proxying requests

By default, requests go through our domain at `cdp.customer.io`. You can proxy requests through your own domain to provide a better privacy and security story, especially when submitting your app to app stores.

To proxy requests, you’ll need to set the `apiHost` and `cdnHost` properties in your `SDKConfigBuilder`. While these are separate settings, you should set them to the same URL.

While you need to initialize the SDK with a `cdpApiKey`, you can set this to any value you want. You only need to pass your actual key when you send requests from your server backend to Customer.io. If you want to secure requests to your proxy server, you can set the `cdpApiKey` to a value representing basic authentication credentials that you handle on your own. See [proxying requests](/integrations/data-in/proxying-requests/) for more information.

```
let config = SDKConfigBuilder(cdpApiKey: "YOUR_CDP_API_KEY")
            .apiHost("YOUR_PROXY_HOST")
            .cdnHost("YOUR_CDN_HOST")

CustomerIO.initialize(withConfig: config.build())
```

## 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 ↗](https://github.com/customerio/customerio-ios/tree/main/Apps/VisionOS).

 ![a preview of the visionOS sample app where you can set traits to test your implementation](https://customer.io/images/visionos-sample-app.png)

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).

---

## Getting started > Swift six

**Source:** /integrations/sdk/ios/getting-started/swift-six

# Swift 6

Swift 6 introduces language changes that can affect how you integrate the Customer.io iOS SDK. This page explains what to expect when your app uses Swift 6.

## General

Swift 6 was introduced in 2024 with Xcode 16. It includes language updates focused on safer, more predictable code, including macro improvements, stronger C++ interoperability, and stronger data-race detection through Strict Concurrency.

Strict Concurrency helps you catch concurrency issues at compile time by enforcing actor isolation, `Sendable` requirements, and safer async boundaries. Many iOS apps are still migrating to Swift 6, while others have already completed the transition and run Swift 6 in production.

## Compatibility

To maintain the broadest compatibility possible, our iOS SDK does not yet depend on Swift 6. Starting with Customer.io iOS SDK version 4.2.0, we have no known compatibility issues for apps that use Swift 6. Future SDK versions will be built with Swift 6, so if your app is still in the migration process, we encourage you to complete that transition.

The demo apps in the iOS repository now build with Swift 6.2 and enable most optional Swift 6 features, including `MEMBER_IMPORT_VISIBILITY`.

## Quirks

Some optional Swift 6 features change library behavior. If you enable these features in your app, your integration may differ from the examples in this documentation.

### MEMBER\_IMPORT\_VISIBILITY

When you enable this flag, you need additional `import` statements. In practice, anywhere you use `import CioDataPipelines`, you should also add `import CioInternalCommon`. As the name implies, `CioInternalCommon` is not intended for direct app usage. It may bring some Customer.io utility classes into scope, but it should not introduce negative side effects.

The same pattern applies when importing `CioMessagingPushAPN` or `CioMessagingPushFCM`; in both cases, also import `CioMessagingPush`.

---

## Getting started > Troubleshooting

**Source:** /integrations/sdk/ios/getting-started/troubleshooting

# Troubleshooting

If you're having trouble with the SDK, here are some basic steps to troubleshoot your problems, and solutions to some known issues.

## Basic troubleshooting steps

1.  **Update to the latest version**: When troubleshooting problems with our SDKs, we generally recommend that you try updating to the latest version. That helps us weed out issues that might have been seen in previous versions of the SDK.
    
2.  **Ask an AI agent**: An AI coding agent that reads our mobile skills can provide immediate help with your implementation, including problems with push and in-app notifications. See [Troubleshoot with an AI agent](#troubleshoot-with-mcp) below.
    
3.  **Enable `debug` logging**: Reproducing your issue with `loglevel` set to `debug` can help you (or us) pinpoint problems.
    
    Don't use debug mode in your production app
    
    Debug mode is great for helping you find problems as you integrate with Customer.io, but we strongly recommend that you set `loglevel` to `error` in your publicly available, production app.
    
4.  **Try our test image**: Using [an image](#image-display-issues) that we know works in push and in-app notifications can help you narrow down problems relating to images in your messages.
    

### If you need to contact support

We’re here to help! If you contact us for help with an SDK-related issue, we’ll generally ask for the following information. Having it ready for us can help us solve your problem faster.

1.  **Share information about your device and environment**: Let us know where you had an issue—the SDK and version of the SDK that you’re using, the specific device, operating system, message, use case, and so on. The more information you share with us, the easier it is for us to weed out externalities and find a solution.
    
2.  **Provide comprehensive debug logs**: When sharing logs with our support team, please ensure your logs include:
    
    *   **SDK initialization**: Show that the SDK was initialized with your site ID and API key
    *   **Person identification**: Show that a person was identified in your app
    *   **Issue reproduction**: Capture the exact issue you’re experiencing
    *   **Unfiltered logs**: Provide complete, unfiltered logs—don’t remove or filter out any log entries
    *   **Debug level enabled**: Make sure `loglevel` is set to `debug` when capturing logs for support
3.  **For push notification issues**:
    
    *   **Use live push examples**: If your issue relates to push notifications, provide logs from a **live push notification** sent through an automation or API call, not a test send. Live pushes show the actual payload that was delivered to the person.
    *   **Test in different app states**: Test and document the issue in various app states:
        *   **Foreground**: App is open and active
        *   **Background**: App is running but not in focus
        *   **Killed/Terminated**: App is completely closed
    *   **Include the push payload**: Share the complete push notification payload that you sent.
4.  **[Grant access to your workspace](/accounts/security/privacy/#support-team-access)**: It may help us to see exactly what triggers an automation, what data is associated with devices you’re troubleshooting, etc. You can grant access for a limited time, and revoke access at any time.
    

## Troubleshoot with an AI agent

An AI coding agent that reads our mobile skills can troubleshoot your implementation, including problems with push and in-app notifications. The skills cover setup, push, and troubleshooting, so your agent can help without necessarily needing you to capture debug logs first.

Your agent reads the skills when you connect the Customer.io plugin for [Claude Code](/ai/plugins/claude/), [Cursor](/ai/plugins/cursor-grok-bot/), or [ChatGPT and Codex](/ai/plugins/chatgpt-codex/), the [MCP server](/ai/mcp/get-started/), or the [CLI](/ai/cli/get-started/). You can also open your mobile source in Customer.io and click **Set up with an agent**.

You can ask basic questions like, “Why aren’t push notifications working? Can you help me troubleshoot the problem?”

Or you can ask more specific questions like, “Deep links in push notifications don’t work for customers in my Android app.” Or “I’m not receiving metrics for push notifications for iOS users.”

Your agent returns detailed steps to help you find and fix the problem.

### Examine data in and data out traffic

Your integrations in Customer.io have *Data in* and *Data out* tabs showing you both the calls that come in from your SDK and the data we send out to your destination(s) respectively. You can examine these calls to help you debug issues.

If you have a problem, go to *Integrations* and check:

1.  That your iOS integration is connected to your workspace. If you don’t connect your integration to your workspace, you won’t be able to send messages, etc. (Typically, it’s connected to your workspace by default.)
2.  Your integration’s *Data In* tab to make sure that your app is sending the right data.
3.  If data isn’t sent to your destination, or it appears incorrect in the destination, go to your outgoing integration’s *Data Out* tab. Check the calls there to make sure that we’re sending the right data from your SDK to the destination. **This includes Customer.io**: your workspace is one of the places you’ll send data from your app!

Check out [Troubleshooting integrations](/integrations/getting-started/troubleshooting/) for more help pinpointing issues in your integration.

## Capture logs

1.  **Enable debug logging in your app**: Everywhere you call `CustomerIO.initialize()`, enable the `debug` log level. This includes in the Notification Service Extension that you [set up for push notifications](/integrations/sdk/ios/push/push-setup/#notification-service-extension).
    
    Note
    
    You should not use debug mode in your production app. Remember to disable debug logging before you release your app to the App Store.
    
    ```
    // During SDK initialization, enable debug logs:
    CustomerIO.initialize(
    withConfig: SDKConfigBuilder(cdpApiKey: "YOUR_CDP_API_KEY")
       .logLevel(.debug)
       .build()
    )
    ```
    
2.  Open the **Console** app (already installed in MacOS). This is a built-in application you can use to view logs produced by the SDK. We recommend that you use Console instead of Xcode to view and capture logs from the SDK because Xcode may not show you all of the logs the SDK generates.
    
     ![Console app after opening](https://customer.io/images/console-after-open.jpg)
    
3.  In Console, click *Action > Include Info messages* and *Action > Include Debug messages*. These settings ensure that you’ll see log messages from the SDK.
    
4.  In Console, on the left, select the iOS device that runs your app with the Customer.io SDK. If you don’t see your device listed, plug in your iOS device into your Mac. Try to use a direct connection via the Apple cable; using a USB hub might prevent the device from showing up.
    
    Then, click **Start streaming**. You will see hundreds or even thousands of logs printed to you. Most of these log messages are not relevant. In the next steps, we’ll filter your log to find relevant messages.
    
5.  In the top right search bar, type “CIO” and press *Enter*.
    
     ![Console app after typing CIO](https://customer.io/images/console-type-cio.jpg)
    
6.  Click the dropdown and select *Category*. You will now only see messages sent from the SDK.
    
     ![Console app after selecting category](https://customer.io/images/console-cio-category.jpg)
    
7.  In the top right, click **Save** to save this filter. The next time you open Console, just click that saved filter along the top of the screen to see Customer.io SDK logs.
    
     ![Console app after saving filter](https://customer.io/images/console-cio-saved-filter.jpg)
    
8.  Click any of the log entries on the screen (or *Edit > Select All*), CMD + C, then CMD + P into a text editor on your computer. Save the file as a .txt.
    
9.  Send the file you just saved to our support team at [win@customer.io](mailto:win@customer.io). In your message, describe your problem and provide relevant information about:
    
    *   The version of the SDK you’re using.
    *   The type of problem you’ve encountered.
    *   An existing GitHub issue URL or existing support email so we know what these log files are in reference to.

## NaN, infinite, or imaginary number values

Customer.io doesn’t handle invalid JSON values in your payloads, like `NaN`, infinite, or imaginary number values. If you send these values in `identify`, `track`, `screen`, or similar calls, we’ll drop them and record errors.

While we drop invalid values, we don’t drop the entire payload. The operation itself will still succeed. For example, if you send an identify call with two attributes, one of which is a `NaN` value, we’ll drop the `NaN` value, but the identify call succeeds with the other attribute.

## Push notification issues

### Problems with rich push notifications (images, delivered metrics, etc)

If you have trouble with rich push features, like images not showing up in your push notifications, delivery metrics not being reported when a push notification is visible on the device, and so on, it’s possible that you either need to re-create your NSE target to support rich notifications or you may not have embedded the `NotificationServiceExtension` (NSE) at all.

1.  Remove your current NSE extension.
    
    1.  In XCode, select your project.
    2.  Go to the *Signing & Capabilities* tab.
    3.  Click the NotificationServiceExtension target; it has a bell icon next to it.
    4.  Click the minus sign to remove the target
    5.  Confirm the **Delete** operation.
    
     ![an image illustrating the 5 clicks you'll perform to delete your NSE target.](https://customer.io/images/delete-nse-1.png)
    
2.  Remove existing NSE files.
    
    1.  Right click the `NotificationServiceExtension` folder in your project and select **Delete**.
    2.  Confirm **Move to Trash**.
    
     ![an image illustrating the steps you'll take to delete NSE files.](https://customer.io/images/delete-nse-2.png)
    
3.  Recreate the notification service extension, following instructions for your framework. When You create your target NSE file, make sure you select your app’s name from the *Embed in Application* dropdown.
    
     ![](https://customer.io/images/xcode-servicenotification3.png)
    
4.  Then add the required files:
    
    *   [React Native](/integrations/sdk/react-native/push-notifications/push/#integrate-push-capabilities-in-your-app)
    *   [Flutter](/integrations/sdk/flutter/push-notifications/push-setup/#swift-push)
    *   Expo (does this automatically)
    *   [iOS](/integrations/sdk/ios/push/push-setup/#notification-service-extension)
5.  After all files are added, go to the NSE target and, under the **General** tab, check **Deployment Target** and set it to a value that is identical to your host app’s iOS version.
    
     ![](https://customer.io/images/troubleshoot-nse.png)
    

When you create a new target, by default, XCode sets the highest version of deployment target version available. While testing if your device’s iOS version is lower than this deployment target, then the NSE won’t be connected to the main target and you won’t receive rich push notifications.

Then you can build and run your app to test if you can receive a rich push notification.

### Why aren’t devices added to people in Production builds?

If you see devices register successfully on your Staging builds, but not in Production or TestFlight builds, there might be an issue with your project setup. Check that the Push capability is enabled for both Release and Debug modes in your project. You might also need to enable the *Background Modes (Remote Notifications)* capability, depending on your project setup and messaging needs.

### Why didn’t everybody in my segment get a push notification?

If your [segment](/journeys/segmentation/data-driven-segments/) doesn’t specify people who have an existing device, it’s likely that people entered your segment without using your app. If you send a push notification to such a segment, the “Sent” count will probably show fewer sends than there were people in your segment.

### Why are messages sent but not delivered or opened?

The *sent* status means that we sent a message to your delivery provider—APNS or FCM. It’ll be marked *delivered* or *opened* when the delivery provider forwards the message to the device and the SDK reports the metric back to Customer.io. If a person turned their device off or put it in airplane mode, they won’t receive your push notification until they’re back on a network.

### FCM `SENDER_ID_MISMATCH` error

This error occurs when the FCM Sender ID in your app does not match the Sender ID in your Firebase project. To resolve this issue, you’ll need to ensure that the Sender ID in your app matches the Sender ID in your Firebase project.

1.  Check that you uploaded the correct JSON certificate to Customer.io. If your JSON certificate represents the wrong Firebase project, you may see this error.
2.  Verify that the Sender ID in your app matches the Sender ID in your Firebase project.
3.  If you imported devices (device tokens) from a previous project, make sure that you imported tokens from the correct Firebase project. If the tokens represent a different app than the one you send push notifications to, you’ll see this error.

### Why don’t my messages play sounds?

When you send a push notification to iOS devices that uses our SDK, you can opt to send the *Default* system sound or no sound at all. If your audience’s phone is set to vibrate, or they’ve disabled sound permissions for your app, the *Default* setting will cause the device to vibrate rather than playing a sound.

In most cases, you should use the *Default* sound setting to make sure your audience hears (or feels) your message. But, before you send sound, you should understand:

1.  Your app needs permission from your users to play sounds. This is done by your app, not our SDKs. [Here’s an example from our iOS sample app ↗](https://github.com/customerio/customerio-ios/blob/main/Apps/APN-UIKit/APN%20UIKit/Util/NotificationUtil.swift#L12-L13) showing how to request sound permissions.
2.  iOS users can go into *System Settings* and disable sound permissions for your app. Enabling the *Default* setting doesn’t guarantee that your audience hears a sound when your message is delivered!

We don't support custom sounds yet

If you want to send a custom sound, you’ll need to handle it on your own, outside the SDK and use a custom payload when you set up your push notifications.

### Image display issues

If you’re having trouble, try using our test image in a message! If it works, then there’s likely a problem with your original image.

 ![a test image of a bird that we know will work with all push notifications](https://customer.io/images/push-image-control.jpg)

Android and iOS devices support different image sizes and formats. In general, you should stick to the smallest size (under 1 MB—the limit for Android devices) and common formats (PNG, JPEG).

iOS

Android

In-App (all platforms)

**Format**

JPEG, PNG, BMP, GIF

JPEG, PNG, BMP

JPEG, PNG, GIF

**Maximum size**

10 MB\*

1 MB

**Maximum resolution**

2048 x 1024 px

1038 x 1038 px

\* For linked media only. If you host images in our Asset Library, you’re limited to 3MB per image.

### Deep links only open in a browser

It sounds like you want to use [universal links](/universal-links/#deep-links-vs-universal-links), links that go to your app if a person has your app installed and to your website if they don't. Universal links are a bit different than your average deep link and require a little bit of additional setup.

You can learn more about setting up universal links [here](/integrations/sdk/ios/push/#universal-links-deep-links). You can easily test universal links using your Notes app. Try adding a link to a note and tap it. If it drives you to your app, then you've set things up correctly.

If your links are opening Safari instead of your app, [check this Apple document to troubleshoot](https://developer.apple.com/documentation/technotes/tn3155-debugging-universal-links).

### Universal Link opens in browser instead of app

If you click on a push notification sent by Customer.io that contains a Universal Link deep link > click on the push notification > app opens for a moment > then the browser opens the URL, this could be a sign that something is wrong with your app’s Universal Link handling.

The Customer.io SDK sends a request to your app’s app to give your app an opportunity to handle the Universal Link. If your app does not handle the Universal Link, the SDK will open the link in the browser instead. Let’s walk through some troubleshooting steps to try and fix this behavior so the browser does not open.

In our [deep links Universal Links guide](/integrations/sdk/ios/push/deep-links/#universal-links-deep-links), we show a function that is required to be added to your app: `application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool`. Add a `print("Universal Links handle code called.")` statement or Xcode breakpoint to verify that your code in this function does get called.

If you click on a push notification and you *do not* see this print statement or breakpoint hit, verify that the deep link URL is a valid `https` URL and you have followed all of the Apple documentation linked in [our Universal Links guide](/integrations/sdk/ios/push/deep-links/#universal-links-deep-links).

If you *do* see your print statement or breakpoint hit, then your Universal Link URL is valid and is correctly attached to the push notification for the SDK to understand. Next, verify that your app returns `true` from the `application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool` function. If your app returns `false`, the SDK will open the Universal Link in the browser instead of the app.

Lastly, check if there is another SDK interfering with the Customer.io SDK. In some cases, customers have reported instances where Universal Links, despite being correctly configured within your app, may unexpectedly open in a web browser. This can occur due to interactions with third-party SDKs that perform method swizzling inside your app. To address this, consider reviewing the documentation of other SDKs integrated into your app and disabling swizzling as needed.

## In-App message issues

### My in-app messages are sent but not delivered

People won’t get your message until they open your app. If you use page rules, they won’t see your message until they visit the right screen(s), so delivery times for in-app messages can vary significantly from other types of messages.

---

## In app > In app event listeners

**Source:** /integrations/sdk/ios/in-app/in-app-event-listeners

# In-app event listeners

When people receive an in-app message, you'll listen for events to handle the message's lifecycle—like dismissing the event or taking a custom action.

## Handle responses to messages (event listeners)

You can set up event listeners to handle your audience’s response to your messages. For example, you might run different code in your app when your audience taps a button in your message or when they dismiss the message without tapping a button.

You can listen for four different events:

*   `messageShown`: a message is “sent” and appears to a user
*   `messageDismissed`: the user closes the message (by tapping an element that uses the `close` action)
*   `errorWithMessage`: the message itself produces an error—this probably prevents the message from appearing to the user
*   `messageActionTaken`: the user performs an action in the message. This includes actions that don’t close the message, like a **Show step** action that moves the user to another step in a [multi-step message](/messaging/channels/in-app/multi-step/).

```
func messageActionTaken(message: InAppMessage, actionValue: String, actionName: String) {
        CustomerIO.shared.track(name: "in-app action", properties: [
            "delivery-id": message.deliveryId,
            "message-id": message.messageId,
            "action-value": actionValue,
            "action-name": actionName
    ])
}
```

## Handling custom actions

When you set up an in-app message, you can determine the “action” to take when someone taps a button, taps your message, etc. In most cases, you’ll want to deep link to a screen, etc. But, in some cases, you might want to execute some custom action or code—like requesting that a user opts into push notifications or enables a particular setting.

In these cases, you’ll want to use the `messageActionTaken` event listener and listen for custom action names or values to execute code. While you’ll have to write custom code to handle custom actions, the SDK helps you [listen for in-app message events](#event-listeners) including your custom action, so you know when to execute your custom code.

1.  When you [add an action to an in-app message](/messaging/channels/in-app/send-in-app-message/) in Customer.io, select *Custom Action* and set your Action’s *Name* and value. The *Name* corresponds to the `actionName`, and the value represents the `actionValue` in your event listener.
    
     ![Set up a custom in-app action](https://customer.io/images/in-app-custom-action.png)
    
2.  [Register an event listener](#event-listener) for `MessageActionTaken`, and listen for the `actionName` or `actionValue` you set up in the previous step.
    
    Use names and values exactly as entered
    
    We don’t modify your action’s name or value, so you’ll need to match the case of names or values exactly as entered in your *Custom Action*.
    
3.  When someone receives a message and invokes the action (tapping a button, tapping a message, etc), your app will perform the custom action.
    

## Dismiss in-app message

You can dismiss the currently display in-app message with the following method. This can be particularly useful to dismiss in-app messages when your audience clicks or taps custom actions.

```
MessagingInApp.shared.dismissMessage()
```

---

## In app > Inbox

**Source:** /integrations/sdk/ios/in-app/inbox

# Notification inbox

## How it works

Unlike other messages, inbox messages don’t necessarily appear immediately to your audience, and they don’t disappear when a person dismisses them. Instead, messages collect in a notification inbox that people can check at their leisure. You send inbox messages as part of an [automation, broadcast](/messaging/channels/in-app/inbox/send-inbox/), or [transactional message](/messaging/channels/in-app/inbox/send-inbox-txnl/).

The SDK gives you two ways to show the inbox in your app:

*   **Recommended: [add the visual inbox](#add-the-visual-inbox).** Mount the SDK’s ready-made inbox views—a bell icon with an unread badge and a panel that lists messages. The SDK renders the [inbox you style and publish](/messaging/channels/in-app/inbox/get-started/) in Customer.io using native UI—no webviews—and handles fetching messages, unread counts, opens, and clicks for you.
*   **Advanced: [build your own inbox](#build-your-own-inbox).** The SDK delivers inbox messages as JSON payloads, and you render them in your own inbox UI. Take this path when you need complete control over the inbox experience.

## Add the visual inbox

The visual inbox renders the same inbox you publish for your website: your icon, colors, position, unread indicator, and message templates—including dark mode styles. When there’s nothing to show—the inbox isn’t published or has no messages—the inbox views render nothing, so they’re safe to mount unconditionally.

### Prerequisites

*   [Create, style, and publish a notification inbox](/messaging/channels/in-app/inbox/get-started/) in your workspace.
*   [Set up in-app messaging](/integrations/sdk/ios/in-app/set-up-in-app/) in your app. The inbox module builds on the in-app messaging module.
*   For the visual inbox, `NotificationInboxOverlay` requires iOS 16+. `NotificationInboxBell` and `NotificationInboxView` work on every iOS version the SDK supports.

### Install the inbox module

The visual inbox ships as its own module, so apps that don’t use it don’t carry its dependencies.

Swift Package Manager (SPM)CocoaPods

#### Swift Package Manager (SPM)

If you haven’t already, follow **[Apple’s instructions ↗](https://developer.apple.com/documentation/swift_packages/adding_package_dependencies_to_your_app)** to add `https://github.com/customerio/customerio-ios.git` as a dependency in Xcode. Then select the `MessagingInbox` package in addition to the packages you already use.

#### CocoaPods

Add the inbox pod to your Podfile and run `pod install`.

```
pod 'CustomerIOMessagingInbox'
```

### Add the inbox to your app

`NotificationInboxOverlay` is the all-in-one option: a floating bell button with an unread badge that slides out the message list, with a scrim that closes it when a person taps outside. Mount it once, near the root of your view hierarchy, so it sits on top of your content.

```
import CioMessagingInbox
import SwiftUI

struct RootView: View {
    var body: some View {
        ZStack {
            AppContent()
            NotificationInboxOverlay()
        }
    }
}
```

That’s the whole integration. The overlay fetches messages, shows and updates the unread badge, marks messages opened when the panel opens, and reports opens and clicks to your [inbox metrics](/messaging/channels/in-app/inbox/metrics/).

### Place the bell and message list yourself

If the floating overlay doesn’t fit your design, compose the two underlying views directly:

*   `NotificationInboxBell`: the bell button with the unread badge. Place it anywhere—a navigation bar, a toolbar, a tab—and use its tap callback to present your inbox.
*   `NotificationInboxView`: the message list without any surrounding chrome. Embed it in a sheet, a tab, or a dedicated inbox screen.

```
import CioMessagingInbox
import SwiftUI

struct DashboardView: View {
    @State private var isInboxPresented = false

    var body: some View {
        AppContent()
            .toolbar {
                NotificationInboxBell {
                    isInboxPresented = true
                }
            }
            .sheet(isPresented: $isInboxPresented) {
                NotificationInboxView()
            }
    }
}
```

In a UIKit app, host the views in a `UIHostingController`:

```
import CioMessagingInbox
import SwiftUI
import UIKit

class DashboardViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()

        // Place the bell where it fits your layout—for example, in your navigation bar
        let bell = UIHostingController(rootView: NotificationInboxBell { [weak self] in
            self?.showInbox()
        })
        bell.view.backgroundColor = .clear
        navigationItem.rightBarButtonItem = UIBarButtonItem(customView: bell.view)
    }

    // Present the message list however you like—a sheet, a pushed screen, or a tab
    func showInbox() {
        let inbox = UIHostingController(rootView: NotificationInboxView())
        present(inbox, animated: true)
    }
}
```

### Handle message actions

When a person taps a message or a button inside it, the SDK runs the action you set on the message: it opens URLs, removes the message for dismiss actions, and so on. If your messages use deep links or you want to route navigation through your own code, set an `InboxEventListener` on the in-app messaging module.

```
import CioMessagingInApp

class InboxListener: InboxEventListener {
    func messageActionTaken(message: InboxMessage, actionName: String, actionValue: String) -> Bool {
        if actionValue.hasPrefix("myapp://") {
            // Navigate within your app
            DeepLinkRouter.shared.open(actionValue)
            // Return true to tell the SDK you handled the action,
            // so it doesn't run its default behavior
            return true
        }
        // Return false to let the SDK handle the action
        return false
    }
}

MessagingInApp.shared.setInboxEventListener(InboxListener())
```

The listener also receives optional, observe-only callbacks you can use for analytics or app state—their return values don’t change SDK behavior:

Callback

When it fires

`messageActionTaken(message:actionName:actionValue:)`

A person taps a non-dismiss action. Return `true` to handle the action yourself, or `false` to let the SDK handle it.

`messageShown(message:)`

A message renders in the visible inbox for the first time.

`messageOpened(message:)`

The SDK marks a message opened—for example, when the panel opens.

`messageDismissed(message:)`

A person dismisses a message, removing it from the inbox.

Dismiss actions always remove the message; they aren’t routed to your listener.

### Visual inbox behaviors

*   **The bell hides itself when there’s nothing to show.** If your inbox isn’t published, or the person has no messages, the bell and panel don’t render at all.
*   **Opening the inbox marks messages opened.** Messages visible in the open panel—or in an embedded `NotificationInboxView`—are marked opened automatically, and the unread badge updates to match.
*   **Dismissing a message deletes it.** When a person dismisses a message, the SDK removes it from their inbox on every device.
*   **Dark mode is automatic.** The inbox follows the device’s appearance and re-renders when it changes, using the dark mode colors you set in Design Studio.
*   **Style changes flow to your app.** When you update your inbox’s styles or templates in Customer.io, the SDK picks up the changes on its next refresh—no app update required.

## Build your own inbox

If you need complete control over the inbox experience, skip the visual inbox and work with the message payloads directly. Customer.io delivers inbox messages as JSON payloads, not fully rendered messages. The SDK helps you listen for these payloads, but you determine how to display them in your own inbox client.

## Get the inbox instance

You’ll access inbox functionality through the `inbox` property on the in-app messaging module.

```
let inbox = MessagingInApp.shared.inbox
```

## Inbox methods

The inbox instance provides several methods to manage messages.

Method

Description

`getMessages()`

Get all messages from the inbox. Returns an async array of messages.

`getMessages(topic:)`

Get messages filtered by topic. Returns an async array of messages.

`messages()`

AsyncStream for all messages with real-time updates. Automatically cleans up when task is canceled.

`messages(topic:)`

AsyncStream for messages filtered by topic. Automatically cleans up when task is canceled.

`addChangeListener(_:)`

Add a listener to be notified when messages change. Requires manual cleanup.

`addChangeListener(_:topic:)`

Add a listener for messages filtered by topic. Requires manual cleanup.

`removeChangeListener(_:)`

Remove a previously added change listener.

`markMessageOpened(message:)`

Mark a message as opened.

`markMessageUnopened(message:)`

Mark a message as unopened.

`markMessageDeleted(message:)`

Mark a message as deleted.

`trackMessageClicked(message:)`

Track a click on the message without an action name.

`trackMessageClicked(message:actionName:)`

Track a click on the message with an action name.

## Inbox message payloads

Inbox messages are delivered as a JSON payload. The SDK helps you listen for the payload, but you’ll render the content in your own inbox client.

The client payload includes the following fields, but you’re most concerned with the `properties` object, which represents your message content. By default, we’ll send a `title` and `body` field, but you can add other fields like an `image` or a `link`—whatever you set up your inbox to expect.

Make sure that your team members know what payloads to send—especially if you expect different payloads for different topics or types of messages.

Field

Type

Description

`messageId`

string

Unique identifier for the message.

`sentAt`

string

When the message was sent.

`expiresAt`

string

When the message will expire.

`opened`

boolean

Whether the message has been opened.

`topics`

array

The topics that the message belongs to.

`type`

string

The type of message.

`properties`

object

The properties of the message.

```
{
    "messageId": "1234567890",
    "sentAt": "2026-02-05T12:00:00Z",
    "expiresAt": "2026-02-05T12:00:00Z",
    "opened": false,
    "topics": ["orders", "shipping"],
    "type": "order_shipped",
    "properties": {
        "title": "Hey Cool Person, your order shipped!",
        "body": "You can track your order #1234567890 here:",
        "link": "https://example.com/orders/1234567890"
    }
}
```

### Inbox topics and types

When you send an inbox message, you can assign it to one or more topics. You can use these topics to filter messages when you fetch them. You can also use the topics to determine how to render the messages in your notification inbox.

Messages also have a `type`. Think of this like a sub-category or topic for a message. For example, you might have `orders` and `sale` topics, where `orders` don’t have images but `sale` topics might. Or, within the `orders` topic, you might have `order_placed` and `order_shipped` types, where `order_placed` lists order details and images of purchased products and `order_shipped` provides a link to the tracking information for the order that opens in a new tab.

## Setup your notification inbox

Inbox messages are just JSON payloads. You’ll need to build your own inbox client to display the messages. The code below gives you a starting point, but you can build your own inbox client however you want.

### Get messages

```
// Get all messages
let messages = await inbox.getMessages()

// Get messages filtered by topic
let promoMessages = await inbox.getMessages(topic: "promo")
```

### Listen for message updates

The SDK provides two approaches for listening to message updates: **AsyncStream** (modern) and **Listener pattern** (classic).

#### AsyncStream (modern approach)

AsyncStream automatically cleans up when the task is canceled, making it ideal for SwiftUI views or structured concurrency.

```
// Stream all messages
Task {
    for await messages in inbox.messages() {
        // Update your UI with the messages
        updateInboxUI(messages)
    }
}

// Stream messages filtered by topic
Task {
    for await messages in inbox.messages(topic: "promo") {
        // Update your UI with filtered messages
        updatePromotionsUI(messages)
    }
}
```

#### Listener pattern (classic approach)

The listener pattern requires manual cleanup but works well with UIKit view controllers.

```
// Your class must conform to NotificationInboxChangeListener
class InboxViewController: UIViewController, NotificationInboxChangeListener {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Add listener (must be called on MainActor)
        Task { @MainActor in
            inbox.addChangeListener(self)
        }
    }

    // Implement the protocol method
    func onMessagesChanged(messages: [InboxMessage]) {
        // Update your UI with the messages
        updateInboxUI(messages)
    }

    deinit {
        // Remove listener when view controller is deallocated
        inbox.removeChangeListener(self)
    }
}

// Add listener for specific topic
Task { @MainActor in
    inbox.addChangeListener(self, topic: "promo")
}
```

### Mark messages as opened or unopened

```
// Mark a message as opened
inbox.markMessageOpened(message: message)

// Mark a message as unopened
inbox.markMessageUnopened(message: message)
```

### Track message clicks

```
// Track a click without an action name
inbox.trackMessageClicked(message: message)

// Track a click with an action name
inbox.trackMessageClicked(message: message, actionName: "view_details")
```

### Delete messages

```
// Mark a message as deleted
inbox.markMessageDeleted(message: message)
```

## Working with message properties

You can access message properties to display custom content in your inbox:

```
// Access message properties
let title = message.properties["title"] as? String
let body = message.properties["body"] as? String
let link = message.properties["link"] as? String
let imageUrl = message.properties["image"] as? String

// Handle message action when user taps
func handleMessageTap(_ message: InboxMessage) {
    // Mark as opened
    inbox.markMessageOpened(message: message)

    // Track click
    inbox.trackMessageClicked(message: message)

    // Open link if available
    if let link = message.properties["link"] as? String,
       let url = URL(string: link) {
        UIApplication.shared.open(url)
    }
}
```

---

## In app > Inline in app

**Source:** /integrations/sdk/ios/in-app/inline-in-app

# Inline in-app messages

Inline in-app messages help you send dynamic content into your app. The messages can look and feel like a part of your app, but provide fresh and timely content without requiring app updates.

## How it works

An inline message targets a specific view in your app. Basically, you’ll create an empty placeholder view in your app’s UI, and we’ll fill it with the content of your message.

This makes it easy to show dynamic content in your app without development effort. You don’t need to force an update every time you want to talk to your audience. *And*, unlike push notifications, banners, toasts, and so on, in-line messages can look like natural parts of your app.

## 1\. Add View to your app UI to support inline messages

Add an inline view to your app’s UI

You’ll add a UI element to your app’s UI code to support inline messages using SwiftUI, Storyboard, Interface Builder, or UIKit via code.

Tip

We’ve set up examples in our [UIKit and SwiftUI sample apps ↗](https://github.com/customerio/customerio-ios/tree/main/Apps/) that might help if you want to see a real-world implementation of this feature.

StoryboardUIKit SwiftSwiftUI

#### Storyboard

1.  Open your storyboard file and drag a `UIView` onto your view controller.
    
2.  Set the class of the `UIView` to `InlineMessageUIView` in the Identity Inspector.
    
3.  Setup layout constraints: you’re responsible for setting the width and the leading, top, trailing, and bottom constraints for the view. See [view layout](#view-layout) for more information.
    
4.  In your `ViewController`, set the `elementId` for the `InlineMessageUIView`. This is the ID you’ll use in the Customer.io UI when you want to send an in-app message.
    
    ```
     import CioMessagingInApp
    
     @IBOutlet weak var inlineInAppView: InlineMessageUIView!
    
     override func viewDidLoad() {
         super.viewDidLoad()
    
         // Replace <element-id-here> with an ID that makes sense to you.
         // You'll use this ID when you build an in-app message in Customer.io.
         inlineInAppView.elementId = "<element-id-here>"
     }
    ```
    

#### UIKit Swift

1.  Create an instance of `InlineMessageUIView` and add it to your view hierarchy.
    
    ```
    import CioMessagingInApp
    
    override func viewDidLoad() {
        super.viewDidLoad()
    
        // Replace <element-id-here> with an ID that makes sense to you.
        // You'll use this ID when you build an in-app message in Customer.io.
        let inlineMessage = InlineMessageUIView(elementId: "<element-id-here>")
    }
    ```
    
2.  Setup layout constraints: you’re responsible for setting the width and the leading, top, trailing, and bottom constraints for the view. See [view layout](#view-layout) for more information.
    

#### SwiftUI

Create an instance of `InlineMessage` and add it to your view hierarchy. You shouldn’t set a height on your View to avoid breaking functionality. `InlineMessage` automatically updates the height for you when messages load and are interacted with.

```
import SwiftUI
import CioMessagingInApp

struct MyScreen: View {
    var body: some View {
        // Replace <element-id-here> with an ID that makes sense to you.
        // You'll use this ID when you build an in-app message in Customer.io.
        InlineMessage(elementId: "<element-id-here>")
        // Note: Avoid setting a hard-coded height on the View to avoid breaking functionality. 
        // The InlineMessage dynamically changes it's height when messages are loaded and interacted with.             
        // .frame() 
    }
}
```

### UIKit: Setup layout constraints for your message

`InlineMessageUIView` uses AutoLayout and modifies its own height. But otherwise, you’ll need to set up layout constraints for the view including the width and the leading, top, trailing, and bottom constraints for the view.

You can create a height constraint, but it won’t matter because we modify it at runtime. You may still want to set a height if you use Storyboard because XCode will throw warnings and errors if you don’t set a height.

## 2\. Build and send your message!

When you add an in-app message to a broadcast or automation in Customer.io:

1.  Set the **Display** to **Inline** and set the **Element ID** to the ID you set in your app.
2.  (Optional) If you send multiple messages to the same Element ID, you’ll also want to set the **Priority**. This determines which message we’ll show to your audience first, if there are multiple messages in the queue.

Then craft and send your message!

 ![in-app message settings with the To field set to ID and the display setting set to inline](https://customer.io/images/in-app-inline.png)

## Handling custom actions

When you set up an in-app message, you can determine the “action” to take when someone taps a button, taps your message, etc. In most cases, you’ll want to deep link to a screen, etc. But, in some cases, you might want to execute some custom action or code—like requesting that a user opts into push notifications or enables a particular setting.

While you’ll have to write custom code to handle custom actions, the SDK helps you listen for in-app message events including your custom action, so you know when to execute your custom code.

Follow these steps to implement custom action buttons for inline messages:

### 1\. Compose an in-app message with a custom action

When you [add an action to an in-app message](/messaging/channels/in-app/send-in-app-message/) in Customer.io, select *Custom Action* and set your Action’s *Name* and value. The *Name* corresponds to the `actionName`, and the value represents the `actionValue` in your event listener.

 ![Set up a custom in-app action](https://customer.io/images/in-app-custom-action.png)

### 2\. Listen for events

For inline in-app messages, you have 2 options for listening to these action click events.

1.  Register a delegate with inline View:
    
    UIKitSwiftUI
    
    #### UIKit
    
    ```
    import CioMessagingInApp
    
    class MyViewController: UIViewController {
        override func viewDidLoad() {
            super.viewDidLoad()
    
            // Given you have an inline View in your ViewController, set a delegate to listen for action events. 
            // Note: The inline View holds a `weak` reference to the `onActionDelegate`. 
            inlineInAppView.onActionDelegate = self
        }
    }
    
    extension MyViewController: InlineMessageUIViewDelegate {
        func onActionClick(message: InAppMessage, actionValue: String, actionName: String) {
            // Perform some logic when people tap an action button. 
    
            // Example code handling button tap: 
            switch(actionValue) { // use actionValue or actionName, depending on how you composed the in-app message. 
                case "enable-auto-renew":
                    // Perform the action to enable auto-renew
                    enableAutoRenew(actionValue)
                 
                // You can add more cases here for other actions
                default:
                    // Handle unknown actions or do nothing
                    print("Unknown action: \(actionName)")
            }
        }
    }
    ```
    
    #### SwiftUI
    
    ```
    import CioMessagingInApp
    import SwiftUI
    
    struct MyScreen: View {
        var body: some View {
            InlineMessage(elementId: "<element-id-here>", onActionClick: { message, actionValue, actionName in
                // Perform some logic when custom action button pressed. 
    
                // Example code handling button press: 
                switch(actionValue) { // use actionValue or actionName, depending on how you composed the in-app message. 
                    case "enable-auto-renew":
                        // Perform the action for enabling auto-renew
                        enableAutoRenew(actionValue)
                     
                    // You can add more cases here for other actions
                    default:
                        // Handle unknown actions or do nothing
                        print("Unknown action: \(actionName)")
                }
            })
        }
    }
    ```
    
2.  Register a global SDK event listener.
    
    When you register an [event listener](../in-app-event-listeners/#event-listeners) with the in-app SDK, we’ll call the `messageActionTaken` event listener. We call this event listener for both modal and inline in-app message types, so you can reuse logic if you want.
    

## Handle responses to messages (event listeners)

Similar to [modal in-app messages](../in-app-event-listeners/#event-listeners), you can set up event listeners to handle your audience’s response to your messages.

For inline messages, you can listen for three different events:

*   `messageShown`: a message is “sent” and appears to a user.
*   `errorWithMessage`: the message itself produces an error—this probably prevents the message from appearing to the user.
*   `messageActionTaken`: the user performs an action in the message. As [shown above](#2-listen-for-events), this is only called if the View instance doesn’t have an `onActionDelegate` set.

Unlike modal in-app messages, you’ll notice that there’s no `messageDismissed` event. This is because inline messages don’t really have a concept of dismissal like modal messages do. They’re meant to be a part of your app!

### Known limitations

We’re actively developing this feature. But, in the meantime, you should be aware of the following limitations:

*   **`InlineMessageUIView` does not work as expected inside a `UITableView`**: If you have a scrolling list, `InlineMessageUIView` works great in `UIStackView` and `UIScrollView`.

---

## In app > Set up in app

**Source:** /integrations/sdk/ios/in-app/set-up-in-app

# Set up in-app messaging

Incorporate in-app messages to send dynamic, personalized content to people using your app. With in-app messages, you can speak directly to your app's users when they use your app.

## How it works

An in-app message is a message that people see within the app; people won’t see your message until they open your app. To set up in app messaging, install and initialize the `CioDataPipelines` and `CioMessagingInApp` packages.

You can also set *page rules* to display your in-app messages when people visit specific pages in your app. However, to take advantage of page rules, you need to use [screen tracking](/integrations/sdk/ios/tracking/track-events/#auto-screenview) features. Screen tracking tells us the names of your pages and which pages a person is visits, so we can display in-app messages on the correct screens (or “pages”) in your app.

With the SDK, you can show modal messages on top of your app’s screens, [inline messages](/integrations/sdk/ios/in-app/inline-in-app/) that become part of a screen, and messages in a [notification inbox](/integrations/sdk/ios/in-app/inbox/) that people can come back to later. See [types of in-app messages](/messaging/channels/in-app/getting-started/#message-types) for every format and the platforms that support it.

## Set up in-app messaging

Use Swift Package Manager to install the `CioMessagingInApp` package. See [Getting Started](/integrations/sdk/ios/quick-start-guide/) for installation instructions. Initializing your app with the `CioMessagingInApp` package sets up your app to receive in-app messages.

```
import CioDataPipelines
import CioInternalCommon
import CioMessagingInApp
import UIKit

@main
class AppDelegateWithCioIntegration: CioAppDelegateWrapper<AppDelegate> {}

class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        var siteId = YOUR_SITE_ID
        
        let config = SDKConfigBuilder(cdpApiKey: YOUR_CDP_API_KEY)
            .autoTrackDeviceAttributes(true)
            .autoTrackUIKitScreenViews()
            .migrationSiteId(siteId)

        CustomerIO.initialize(withConfig: config.build())

        // Initialize messaging features after initializing Customer.io SDK
        // Before iOS SDK 4.12.0, use MessagingInAppConfigBuilder(siteId: siteId, region: .US), and use .EU if your account is in our EU data center.
        MessagingInApp
            .initialize(withConfig: MessagingInAppConfigBuilder(siteId: siteId).build())
            .setEventListener(self)

        return true
    }
}   
```

## Anonymous messages

As of version 3.14, you can send [anonymous in-app messages](/journeys/anonymous-in-app/). These are messages that are sent *only* to people you haven't identified yet.

You *can* use lead forms in anonymous messages to capture leads and potentially identify people when they submit your form. For example, you could use a lead form and offer a coupon or newsletter to people who provide their email addresses. See [Lead forms](/journeys/messages-and-webhooks/in-app/lead-form/) for more information.

## In-app configuration options

No site ID with a public key

In iOS SDK 5.1.0 and later, if your API key starts with `pk_`, you can leave out the site ID and use `MessagingInAppConfigBuilder()`. The SDK finds your workspace from your key.

You can pass the following options when you initialize the `MessagingInApp` package.

Option

Type

Default

Description

`siteId`

string

The [Site ID](https://fly.customer.io/env/last/settings/api_credentials) from a set of Track API credentials; this determines the workspace that your app listens for in-app messages from. Optional with a `pk_` key.

`region`

`Region.US` or `Region.EU`

The region your Customer.io account resides in. Ignored in iOS SDK 4.12.0 and later, where in-app uses the region you initialize the SDK with.

## Set the color scheme

New in v4.6.0

In-app messages follow the device’s light or dark-mode appearance by default. When someone uses dark mode, messages render with the [dark mode values](/messaging/channels/in-app/global-styles-in-app/#set-light-and-dark-mode-styles) you set for your in-app messages in Design Studio. Where a message has no dark value, it keeps its light-mode styles in both modes.

Set the `colorScheme` option when you initialize the `MessagingInApp` package to override this behavior.

Value

Description

`.auto`

**(Default)** Follow the device appearance and switch automatically when the device does.

`.light`

Always render light styles.

`.dark`

Always render dark styles.

```
MessagingInApp.initialize(
    withConfig: MessagingInAppConfigBuilder(siteId: siteId)
        .setColorScheme(.dark)
        .build()
)
```

You can also change the color scheme at runtime. The new value applies to messages already on screen and persists for the rest of the session.

```
MessagingInApp.shared.setColorScheme(.dark)
```

---

## In app > Target in app messages

**Source:** /integrations/sdk/ios/in-app/target-in-app-messages

# Page rules

Sending people in-app messages often depends on the screens they visit in your app.

You can set page rules when you create in-app messages. These rules determine the pages that your audience must visit in your app to see each message. Before you can take advantage of page rules, you need to:

1.  Track screens in your app. You can add `$0.autoTrackScreenViews = true` to your `CustomerIO.config` to automatically track screens or you can [track screens manually](/integrations/sdk/ios/tracking/screen-events/#manual-screenview).
2.  Provide page names to whomever sets up in-app messages in fly.customer.io. If we don’t recognize the page that you set for a page rule, your audience will never see your message.

The SDK automatically uses the class name of `UIViewController`, minus `ViewController`, as the name of each page. For example, if you wanted to display an in-app message on a class called `EditProfileViewController`, you would enter `EditProfile` as your page rule.

Make sure your screens use the same names across your apps

If you have a screen called `DashboardActivity` in Android, and `DashboardViewController` in iOS, we’ll recognize `Dashboard` as the screen for both platforms, making it easier for you to set page rules and track events for users across platforms.

 ![Set up page rules to limit in app messages by page](https://customer.io/images/in-app-page-rule.png)

Keep in mind: page rules are case sensitive. If you’re targeting your mobile app, make sure your page rules match the casing of the `name` in your `screen` events. If you’re targeting your website, your page rules should always be lowercase.

 ![The first page rule is Web contains /dashboard. The second page rule is iOS contains Dashboard.](https://customer.io/images/page-rule-case-sensitive.png)

---

## Live activities > Reference

**Source:** /integrations/sdk/ios/live-activities/reference

# Live Activities API and payload reference

Your server drives every Live Activity through the [Live Notifications API](/integrations/api/app/tag/live-notifications/). This page covers the operations, the two objects you send with each one, the bundled templates, and the APNs payload that arrives on the device.

For the app-side work—defining your activity’s data model, building your widget, and initializing the module—see [Set up Live Activities](/integrations/sdk/ios/live-activities/set-up/).

## Notification types

Every live notification belongs to a **notification type**. Each type has an `identifier` in reverse-DNS notation, like `io.customer.order-tracking`, so the identifier stays unique. Identifiers work well in code but are hard to scan in a list, so you can also assign a friendly `name` that appears in your activity logs.

A type is the *kind* of thing you track—an order, a ride, a match. Each running notification is an **instance** of that type, with its own `instance_id`. Your update, end, and status calls all reference a notification by its `instance_id`.

Customer.io records a notification type automatically when it receives the type’s SDK registration or its first start request. You can view your types and edit their friendly names under [**Settings** > **Live notifications**](https://fly.customer.io/workspaces/last/settings/live-notification-types). There’s no create or delete action, and you can’t edit an identifier.

 ![The live notification types table in workspace settings, showing each type's friendly name and reverse-DNS identifier](https://customer.io/images/live-activity-table.png)

## Activity lifecycle

Every live notification has a unique `instance_id` that you use to track its lifecycle and target its updates. Each instance holds every delivery made over the notification’s lifespan.

*   [When you start a notification from the API](/integrations/api/app/tag/live-notifications/startLiveNotification/), Customer.io generates the instance ID and returns it in the response.
*   When the notification starts from your app, the SDK generates it.

An instance can move through these states:

State

Meaning

`active`

The notification is running and can receive updates.

`ended`

Your app or server ended it.

`expired`

It passed its expiration without being ended.

`failed`

Customer.io couldn’t deliver to it.

### Start a notification

You can start a live notification two ways:

*   **From your app**: Your app starts the notification on the device—the moment a customer places an order, for example. This works while your app is in the foreground.
*   **From your server**: Your server calls the [start endpoint](/integrations/api/app/tag/live-notifications/startLiveNotification/) and Customer.io pushes to the device. Your app doesn’t need to be open.

Either way, the SDK reports the notification to Customer.io, and Customer.io pushes updates to it from that point on.

### Update a running notification

Your server updates live notifications through the [update endpoint](/integrations/api/app/tag/live-notifications/updateLiveNotification/), referencing the notification by its instance ID. Customer.io looks up the notification’s token and pushes the new content state to the device. The operating system re-renders it without launching your app.

Each update must carry the **full** content state. You can’t send partial updates that contain only the fields that changed.

Your app can also update a notification locally through the SDK. But SDK-side updates only change the notification on the device. The update doesn’t appear in the Customer.io delivery timeline. (Note that SDK-managed local starts and ends *do* appear in the delivery timeline.)

### End a notification

There are three ways to end a live notification:

*   **Your server** sends an [end request](/integrations/api/app/tag/live-notifications/endLiveNotification/) to Customer.io, which delivers a final push that transitions the notification to its ended state. You can include a final `content_state` to show before it ends; it defaults to the last state you sent.
*   **Your app** ends it locally, and the SDK reports the end to Customer.io.
*   **Automatic expiration.** Customer.io marks a notification `expired` 6 hours after it starts by default. You can set an earlier expiration with the `expiration` field on the [start request](/integrations/api/app/tag/live-notifications/startLiveNotification/), but 6 hours is the maximum. Expiration changes the status in Customer.io—it doesn’t send an end push or clear the notification from the device.

Server control and app control aren’t exclusive: you can start an activity in your app for instant feedback and hand it to your server for updates, or start it from your server and end it in your app. However, local updates never enter the delivery timeline, so a notification you drive from both places will have gaps in its Customer.io history.

### Review deliveries

Live notifications are a delivery channel in Customer.io. Every start, update, and end is a separate **delivery**, so one notification produces a timeline of deliveries over its lifespan. Each delivery moves through various statuses: `queued`, `sent`, `attempted`, `failed`, or `undeliverable`. In general, queued and sent deliveries are good states; failed and undeliverable deliveries mean your live notification didn’t make it to the device.

You can see every live notification sent to a person, and drill into each instance’s full delivery timeline, on their profile. See [Monitor live notifications](/messaging/channels/live-notifications/monitor/) for more.

## Attributes and content state

When you [start](/integrations/api/app/tag/live-notifications/startLiveNotification/), [update](/integrations/api/app/tag/live-notifications/updateLiveNotification/), or [end](/integrations/api/app/tag/live-notifications/endLiveNotification/) a live notification through the API, you send two objects: `attributes` and `content_state`. Customer.io wraps them in the right platform payload and delivers them to the device.

*   `attributes` describe the thing the notification is *about*—the order, the flight, the match. You set them when the notification starts, and they stay fixed for its lifetime.
*   `content_state` is what the notification *currently shows*—the status, the score, the ETA. It changes with every update, and the device re-renders from it each time.

When you design a notification type, that’s the test for where a field goes: if it can change while the notification is running, it belongs in `content_state`. If it identifies what the notification is tracking, it’s an attribute.

A few conventions apply:

*   **Dates and timestamps are epoch seconds**, not milliseconds. Use the Unix format.
*   **Each update carries the full content state.** The device re-renders from the complete state on every push. There are no partial updates.
*   **Static fields behave differently per platform.** On iOS, ActivityKit fixes `attributes` when the activity is created and keeps them for its lifetime, so you send them only on start. On Android, the device re-renders from each push, so re-send `attributes` on every update and end—otherwise the static fields disappear.

Attributes are immutable on iOS

This split is ActivityKit’s own model: `attributes` populates your `ActivityAttributes` type, and `content_state` populates its `ContentState`. ActivityKit fixes an activity’s attributes when the activity is created, so Customer.io sends them only on the start push. Anything that changes over the activity’s life belongs in `content_state`.

## Built-in templates

The built-in templates are the lowest-effort way to ship a live notification: when one of the two shapes—a countdown or a step-by-step tracker—fits what you need, Customer.io renders it for you. You don’t have to write any UI code. You control the content the template shows (and, on Android, template branding like an accent color and logo), but the layout is fixed—you can’t rearrange a built-in template’s views. For anything else, you need to define a custom type and render it yourself.

Both built-in templates use the same [notification type identifiers](#notification-types) on iOS and Android, so one cross-platform notification can share a single `notification_type`. You send static fields in `attributes` and dynamic fields in `content_state`; each template below shows an example, followed by schemas for both objects. The fields the templates render verbatim (`header`, `title`, `status`, `substatus`) are freeform text, but the supported fields are only the ones in each schema—the bundled templates don’t expose generic status-color, image, or logo fields.

### Countdown timer

Use this template to create a countdown timer, with the notification type `io.customer.livenotifications.countdowntimer`. A complete start request wraps the template’s `attributes` and `content_state` (documented below) in the standard [start request](/integrations/api/app/tag/live-notifications/startLiveNotification/) fields—`identifiers`, `notification_type`, and `push_payload`:

```
{
    "identifiers": { "email": "person@example.com" },
    "notification_type": "io.customer.livenotifications.countdowntimer",
    "push_payload": { "alert": { "title": "Summer sale is live", "body": "Tap to see today's deals" } },
    "attributes": {
        "header": "Summer Sale"
    },
    "content_state": {
        "title": "Flash sale ends in",
        "statusMessage": "30% off everything",
        "endTime": 1753603600
    }
}
```

#### Attributes

*   headerstringrequired
    
    Top-row label of the notification.
    

#### Content state

*   titlestringrequired
    
    Primary status line.
    
*   endTimeinteger
    
    Countdown target, in whole seconds since 1970 UTC. A time in the future renders a live countdown; omit it to render no timer. The countdown does not clear itself when it reaches zero — it rests at \\"0:00\\" until you send an update with a finished title and no endTime.
    
*   statusMessagestring
    
    Secondary line under the title.
    

### Multi-step tracker

Use this template to create a delivery process tracker, or any tracker with steps, with the notification type `io.customer.livenotifications.segments`. A complete start request wraps the template’s `attributes` and `content_state` (documented below) in the standard [start request](/integrations/api/app/tag/live-notifications/startLiveNotification/) fields—`identifiers`, `notification_type`, and `push_payload`:

```
{
    "identifiers": { "email": "person@example.com" },
    "notification_type": "io.customer.livenotifications.segments",
    "push_payload": { "alert": { "title": "Your order is on its way", "body": "Track it live on your Lock Screen" } },
    "attributes": {
        "header": "Chica's Tacos"
    },
    "content_state": {
        "status": "Preparing your order",
        "substatus": "We'll let you know when it's on the way",
        "segmentsTotal": 4,
        "segmentsComplete": 2,
        "trailingText": "25 min"
    }
}
```

#### Attributes

*   headerstringrequired
    
    Top-row label
    

#### Content state

*   segmentsCompleteintegerrequired
    
    How many segments are filled; the remainder render as incomplete. Values above segmentsTotal are capped at segmentsTotal.
    
*   segmentsTotalintegerrequired
    
    The total number of segments in the progress bar. Values above 20 are capped at 20.
    
*   statusstringrequired
    
    Primary status line, like `Out for delivery`.
    
*   substatusstring
    
    Secondary line under the status.
    
*   trailingTextstring
    
    Short text on the Dynamic Island trailing edge, e.g. \\"5 min\\". Keep it brief; the trailing region is narrow.
    

## What Customer.io sends to APNs

You never build the APNs payload—Customer.io assembles it from the objects you send to the API, and ActivityKit decodes it into your types. But three parts of it are a contract your Swift code has to match:

*   **`attributes-type`** is the name of your `ActivityAttributes` type. It rides only on the start push (attributes are immutable once the activity is created) and must match a registered type, or ActivityKit can’t create the activity. Customer.io injects `cioInstanceId` into `attributes` so the SDK can correlate the activity.
*   **`content-state`** decodes directly into your `ContentState`, so its field names have to match your Swift properties. It rides on every push.
*   **`cioMetadata`**, injected into `content-state`, carries the delivery ID, delivery token, and deep link. Declare it on your `ContentState` (the SDK’s `CIOMetadataCarrying` protocol) to get tap-through deep links and delivery attribution.

The `alert` you set with `push_payload.alert` becomes the notification’s alert: required on an iOS start, optional on updates and ends (include both `title` and `body` when you do). This is identical whether your app receives push directly through APNs or nested in Firebase’s FCM envelope—the content doesn’t change.

---

## Live activities > Set up

**Source:** /integrations/sdk/ios/live-activities/set-up

# Set up Live Activities

Live Activities push real-time, continuously updated notifications to the iOS Lock Screen and Dynamic Island—a delivery tracker, a live score, a countdown. Define your activity's data model, render it with your own widget, and let Customer.io push updates without your app being open.

Minimum requirements

Live Activities require iOS 16.2 or later—iOS 17.2 or later for push-to-start (starting activities from your server). Your app must also have the push module (`MessagingPushAPN` or `MessagingPushFCM`) configured and must identify the person before the SDK registers tokens: Live Activities register their tokens and report their lifecycle events through the device’s push token, so without one, nothing registers or reports. Live Activities are available on the native iOS SDK installed with either Swift Package Manager or CocoaPods.

## How it works

A Live Activity is Apple’s format for glanceable, continuously updated content on the Lock Screen and in the Dynamic Island, built on the [ActivityKit ↗](https://developer.apple.com/documentation/activitykit) framework. Unlike a standard push, it doesn’t arrive once and sit in a list—it’s a persistent surface that re-renders each time new state arrives. Apple’s [Human Interface Guidelines ↗](https://developer.apple.com/design/human-interface-guidelines/live-activities) cover what makes a good one.

Four actors drive every Live Activity:

*   **You** define an ActivityKit `ActivityAttributes` type describing your activity’s data, and a widget that renders it. The SDK never renders your activity. The design is entirely yours.
*   **The SDK** observes activities of the types you register, captures and registers push tokens, and reports the starts and ends your app drives, plus a customer’s dismissal, to Customer.io. Local updates change the activity on the device only.
*   **Your server** starts, updates, and ends activities by calling [the API](/integrations/api/app/tag/live-notifications/). It never talks to APNs.
*   **Customer.io** turns each API call into an APNs push, using the tokens the SDK registered, and records every start, update, and end as a delivery.

Customer.io sits in the middle: your server only ever calls the API, the SDK keeps Customer.io supplied with the device’s push tokens, and APNs delivers each update to the widget you built. The SDK never handles the pushes themselves—iOS applies them directly, which is why updates keep rendering when your app isn’t running. For the API operations, payload shapes, and bundled templates, see the [API and payload reference](/integrations/sdk/ios/live-activities/reference/).

## Before you begin

Complete two one-time setup steps in Xcode:

1.  **Add a Widget Extension target** (**File** > **New** > **Target** > **Widget Extension**) if you don’t already have one. Your Live Activity UI lives here.
2.  **Enable Live Activities** by setting `NSSupportsLiveActivities` to `YES` in your app target’s Info settings. If your activity updates frequently, also set `NSSupportsLiveActivitiesFrequentUpdates` to `YES`.

Live Activities use your existing push credentials, APNs or FCM. The SDK calls `registerForRemoteNotifications` without requesting alert authorization. This registers the APNs token and, in the Firebase integration, obtains and registers the FCM token without showing a notification-permission prompt.

You must also identify your app user before you can start an activity. The SDK holds token registrations until you identify a person, and [the API](/integrations/api/app/tag/live-notifications/startLiveNotification/) rejects requests that target anonymous profiles.

Live Activities don't require notification permission

ActivityKit generates its own tokens independently of notification permission, so your customers can receive live notifications **even if they’ve denied push notifications** on either delivery path. You don’t have to manage a permission prompt.

## Step 1: Add the SDK packages

Live Activities require two packages. Add each to the correct target, using the names for your dependency manager:

Installation

App target

Widget extension

Templates (optional)

Swift Package Manager

`LiveActivities`

`LiveActivities_Attributes`

`LiveActivities_Templates`

CocoaPods

`CustomerIOLiveActivities`

`CustomerIOLiveActivitiesAttributes`

`CustomerIOLiveActivitiesTemplates`

The attributes package (`LiveActivities_Attributes` or `CustomerIOLiveActivitiesAttributes`) has no SDK dependencies. It ships the types your widget shares with your app, the epoch-second date decoder, and the `.cioWidgetUrl` widget modifier—but none of the SDK’s networking or lifecycle machinery. That’s why it’s safe to import in your widget extension, which needs it to share your activity’s data model with your app. You’ll add it to **both** the app target and the widget extension target.

If you want to use our pre-configured templates, you’ll also add the templates library to both targets—`LiveActivities_Templates` with Swift Package Manager, or `CustomerIOLiveActivitiesTemplates` with CocoaPods.

## Step 2: Define your activity’s data model

Create an `ActivityAttributes` type describing your activity. Make the file a member of **both** your app target and your widget extension target. ActivityKit matches the two sides by the type’s name and `Codable` shape. A single source file for both targets is the intended pattern.

```
import ActivityKit
import CioLiveActivities_Attributes

struct DeliveryActivityAttributes: CIOActivityAttribute {
    // Reverse-DNS identifier, registered with the SDK and matched
    // server-side to route pushes.
    static let identifier = "io.customer.liveactivities.deliverytracking"

    // Managed by Customer.io. Declare it with a default and never set it
    // yourself—the SDK fills it in on local start, and Customer.io fills
    // it in for push-to-start.
    var cioInstanceId: String = ""

    // Your static fields—set once at start, never change.
    var orderNumber: String

    // Your dynamic fields—updated over the activity's life.
    struct ContentState: Codable, Hashable, CIOMetadataCarrying {
        var title: String
        var subtitle: String?
        var estimatedArrival: EpochSecondsDate?

        // Deep-link and delivery metadata for the push that produced
        // this state. nil for locally-driven updates.
        var cioMetadata: CIOLiveActivityMetadata?
    }
}
```

*   `CIOActivityAttribute` is a one-property protocol (`cioInstanceId`) that opts your activity type into **push-to-start**, so your server can create the activity remotely. A plain `ActivityAttributes` type also works. The SDK still observes it for local starts, updates, and ends, but you can only start conforming activity types from your server.
*   `CIOMetadataCarrying` is optional. Declare `cioMetadata` on your `ContentState` to receive each update’s deep link and delivery attribution.
*   `EpochSecondsDate` decodes the epoch-second date fields Customer.io sends, so live countdowns work without custom decoding.

## Step 3: Build your widget

Render your activity in your widget extension with a standard ActivityKit `ActivityConfiguration`. This is your SwiftUI—Customer.io doesn’t constrain the design.

Use `.cioWidgetUrl(context.state.cioMetadata)` so a tap opens the deep link your server attached to the latest push and is attributed to the exact delivery. Make sure you add the widget to your extension’s `WidgetBundle`.

```
import ActivityKit
import CioLiveActivities_Attributes
import SwiftUI
import WidgetKit

struct DeliveryActivityWidget: Widget {
    var body: some WidgetConfiguration {
        ActivityConfiguration(for: DeliveryActivityAttributes.self) { context in
            // Your Lock Screen view
            DeliveryLockScreenView(state: context.state)
                .cioWidgetUrl(context.state.cioMetadata)
        } dynamicIsland: { context in
            DynamicIsland {
                DynamicIslandExpandedRegion(.bottom) {
                    Text(context.state.title)
                }
            } compactLeading: {
                Image(systemName: "shippingbox.fill")
            } compactTrailing: {
                Text(context.state.subtitle ?? "")
            } minimal: {
                Image(systemName: "shippingbox.fill")
            }
        }
    }
}
```

## Step 4: Initialize the module

Add the Live Activities module to your SDK configuration and register each activity type you want Customer.io to observe. The module is registered with the main SDK, so there’s no separate instance to hold onto—you drive activities through `CustomerIO.liveActivities`.

```
import CioDataPipelines
import CioLiveActivities

let configBuilder = SDKConfigBuilder(cdpApiKey: "YOUR_CDP_API_KEY")

if #available(iOS 16.2, *) {
    configBuilder.addModule(
        LiveActivitiesModule(
            config: LiveActivityConfigBuilder()
                .register(
                    DeliveryActivityAttributes.self,
                    identifier: DeliveryActivityAttributes.identifier
                )
                .build()
        )
    )
}

CustomerIO.initialize(withConfig: configBuilder.build())
```

The `register` call tells the SDK which activity type to watch. From here on, the SDK observes any activity of that type automatically, registers its tokens with Customer.io, and reports its lifecycle. There’s no per-activity code.

## Step 5: Handle deep links

When a customer taps an activity, and the latest push carried a deep link, iOS opens your app with the widget URL. Pass it through `CustomerIO.liveActivities.handleWidgetUrl(_:)` before your own routing so the tap is attributed to the exact delivery.

If your app uses an AppDelegate lifecycle, handle the URL there:

```
func application(_ app: UIApplication, open url: URL,
                 options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
    guard let destination = CustomerIO.liveActivities.handleWidgetUrl(url) else {
        return true
    }
    return handleDeepLink(destination)
}
```

`handleWidgetUrl` records the tap for metrics. For non-Customer.io URLs, it returns the original URL unchanged. For a Customer.io widget URL, it returns the embedded destination, or nil if no destination was provided.

This means that if you intend for a notification to deep link into your app, you should include it in every payload you send.

### Handle Live Activity taps in a UIScene app

If your app adopts `UIScene`, or you build it with the iOS 27 SDK and run it on iOS 27 or later, the system delivers the widget URL to your `UISceneDelegate` instead of your AppDelegate. Keep `CustomerIO.initialize`, APNs registration, and `UNUserNotificationCenter` handling in your AppDelegate. Your app still owns the SceneDelegate, root window, and final navigation.

Route the widget URL through `handleWidgetUrl(_:)` exactly once: on a cold launch from `scene(_:willConnectTo:options:)`, or on a warm open from `scene(_:openURLContexts:)`. A `nil` result means the activity had no destination; an ordinary URL is returned unchanged so your normal routing handles it.

```
import CioDataPipelines
import CioLiveActivities
import UIKit

class SceneDelegate: UIResponder, UIWindowSceneDelegate {
    var window: UIWindow?

    func scene(_ scene: UIScene, willConnectTo session: UISceneSession,
               options connectionOptions: UIScene.ConnectionOptions) {
        guard let windowScene = (scene as? UIWindowScene) else { return }
        window = UIWindow(windowScene: windowScene)
        // Set up your root view controller, then window?.makeKeyAndVisible().

        // Cold launch: a Live Activity tap arrives in the connection options.
        handle(urlContexts: connectionOptions.urlContexts)
    }

    // Warm app: a Live Activity tap while the scene is connected.
    func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
        handle(urlContexts: URLContexts)
    }

    private func handle(urlContexts: Set<UIOpenURLContext>) {
        for context in urlContexts {
            // Attribute the tap and unwrap the destination before routing.
            guard let destination = CustomerIO.liveActivities.handleWidgetUrl(context.url) else {
                continue
            }
            _ = handleDeepLink(destination)
        }
    }
}
```

For app-scheme and universal-link handling that isn’t tied to Live Activities, see [Handle deep links in a UIScene app](/integrations/sdk/ios/push/deep-links/#uiscene-deep-links). For the full cross-SDK walkthrough, see the [iOS 27 UIScene migration guide](/integrations/sdk/ios/whats-new/ios-27-uiscene-migration/).

Next, [start a Live Activity](/integrations/sdk/ios/live-activities/start/) from your server with push-to-start or from your app.

---

## Live activities > Start

**Source:** /integrations/sdk/ios/live-activities/start

# Start Live Activities

Once you’ve [set up Live Activities](/integrations/sdk/ios/live-activities/set-up/), there are two ways to start one:

*   **From your server (push-to-start):** You call [the API](/integrations/api/app/tag/live-notifications/startLiveNotification/) when you’re ready to start an activity, and iOS creates it on the device. Your app doesn’t need to be open. This is the most common path for activities like delivery tracking and live scores, and requires iOS 17.2.
*   **From your app:** Start the activity through the module when something happens in the app. This is a common path for activities like a workout progress tracker.

## From your server (push-to-start)

Call the [start endpoint](/integrations/api/app/tag/live-notifications/startLiveNotification/) to start an activity for a person. Customer.io sends the push-to-start message, and iOS creates the activity with the attributes and content state from your payload. Your payload must include `push_payload.alert.title` and `push_payload.alert.body`.

Push-to-start requires iOS 17.2 or later.

## From your app

Start the activity through the module—when a customer places an order, for example:

```
if #available(iOS 16.2, *) {
    // start throws only on a genuine ActivityKit failure (Live Activities
    // disabled, unsupported device). It returns nil—logged, never thrown—if
    // the module isn't initialized or the type wasn't registered.
    guard let activity = try CustomerIO.liveActivities.start(
        DeliveryActivityAttributes(orderNumber: "CIO-1234"),
        contentState: .init(title: "Order received")
    ) else { return }

    // update and end are async.
    await activity.update(.init(title: "Out for delivery"))
    await activity.end(
        .init(title: "Delivered"),
        // Keep the final state on screen briefly before the system removes it.
        dismissalPolicy: .after(.now + 60)
    )
}
```

`start` is available on iOS 16.2 and later and returns a `CIOLiveActivity` handle, or `nil` if the module isn’t initialized or the type wasn’t registered.

The handle’s `update(_:)` and `end(_:)` are `async`: `update` changes the activity on the device but isn’t reported to Customer.io, and `end(_:dismissalPolicy:)` ends it locally, reports the end, and lets you control how long the final state stays on screen.

The handle’s `id` is the activity’s instance ID—pass it to your backend if you want your server to take over updates. If your app already starts activities with raw ActivityKit calls, pass them to `CustomerIO.liveActivities.adopt(_:)` so the SDK can manage future updates and the end—but note that `adopt` doesn’t report that activity’s original start.

## Update and end the activity

Once the activity is running, your server can push subsequent updates by calling the [update endpoint](/integrations/api/app/tag/live-notifications/updateLiveNotification/) with the activity’s instance ID. You don’t need to manage push tokens yourself.

When your server ends an activity, iOS dismisses it from the Lock Screen. You can set a dismissal time that keeps the final state visible for a short while before the system removes it. This is useful when you want to make sure someone sees a final score or that their order was delivered.

For the full lifecycle, states, instance IDs, and how deliveries appear in Customer.io, see the [API and payload reference](/integrations/sdk/ios/live-activities/reference/).

## How the SDK registers push tokens

The SDK registers Live Activity push tokens with Customer.io automatically—you don’t manage tokens yourself. Registration is held until there’s **both** an identified person and a registered device token, then flushed automatically. If a live activity doesn’t start, registration is the first thing you should check.

Behind that, ActivityKit issues two kinds of token and the SDK handles each: a **push-to-start token** (one per activity type, so your server can create an activity without your app open—iOS 17.2 or later) and an **instance token** minted when an activity starts (so Customer.io can update or end that specific activity). Both can rotate; the SDK re-registers new values as they change so updates flow without interruption.

---

## Push > App groups

**Source:** /integrations/sdk/ios/push/app-groups

# App Groups for push tracking

Configure App Groups for reliable push delivery tracking. App Groups let the SDK recover delivery metrics that iOS might otherwise discard when it terminates the Notification Service Extension.

App Groups are required for reliable push delivery tracking. Without this setup, delivery metrics may be lost if iOS terminates the Notification Service Extension before the tracking request completes. With App Groups configured, the SDK automatically recovers any lost metrics on the next app launch.

## Before you begin

Before you configure App Groups, make sure you’ve completed the following:

*   [Set up push notifications](/integrations/sdk/ios/push/push-setup/) in your app
*   [Add a Notification Service Extension (NSE)](/integrations/sdk/ios/push/push-setup/#notification-service-extension) to your app

## 1\. Add the App Group capability in Xcode

You need to add the App Groups capability to both your main app target and your Notification Service Extension target in Xcode.

Automatic signingManual signing

#### Automatic signing

If you use automatic signing (the most common setup), this is the only step outside of code. Xcode registers the group and updates provisioning profiles automatically.

1.  In Xcode, select your **main app target** > **Signing & Capabilities** > **\+ Capability** > **App Groups**.
2.  Click **+** and enter your group identifier—for example, `group.com.example.myapp.cio`.
3.  Select your **Notification Service Extension target** > **Signing & Capabilities** > **\+ Capability** > **App Groups**.
4.  Select the **same** App Group you created in step 2.

Both targets must reference the exact same App Group string.

#### Manual signing

If you use manual signing, you need to register the group in the Apple Developer Portal and regenerate your provisioning profiles.

1.  Sign in to the [Apple Developer Portal ↗](https://developer.apple.com/) and go to **Certificates, Identifiers & Profiles**.
2.  Click **Identifiers** > **+** > **App Groups**.
3.  Enter your identifier. It must start with `group.`—for example, `group.com.example.myapp.cio`.
4.  Under **Identifiers**, select your main app’s App ID, enable **App Groups**, click **Configure**, and select your group.
5.  Repeat step 4 for your Notification Service Extension’s App ID.
6.  Regenerate provisioning profiles for both your main app and Notification Service Extension. Enabling App Groups invalidates your existing provisioning profiles.

Warning

You must regenerate your provisioning profiles in the Apple Developer Portal after enabling App Groups. You don’t need to regenerate certificates.

Already have an App Group?

You can reuse an existing App Group by passing its identifier to `.appGroupId()`. There’s no conflict in having multiple App Groups on a target.

## 2\. Pass the App Group ID in your SDK configuration

After you add the App Group capability, pass the App Group ID to the SDK in both your host app and your Notification Service Extension. Both are required—App Groups work by sharing storage between the two targets, so the SDK needs the identifier in each place to read and write delivery metrics. The App Group ID must be identical in both places and must match the entitlements you set up in Xcode.

### Host app initialization

APNsFCM

#### APNs

```
MessagingPushAPN.initialize(
    withConfig: MessagingPushConfigBuilder()
        .appGroupId("group.com.example.myapp.cio")
        .build()
)
```

#### FCM

```
MessagingPushFCM.initialize(
    withConfig: MessagingPushConfigBuilder()
        .appGroupId("group.com.example.myapp.cio")
        .build()
)
```

### Notification Service Extension initialization

APNsFCM

#### APNs

```
MessagingPushAPN.initializeForExtension(
    withConfig: MessagingPushConfigBuilder(cdpApiKey: "YOUR_CDP_API_KEY")
        .appGroupId("group.com.example.myapp.cio")
        .build()
)
```

#### FCM

```
MessagingPushFCM.initializeForExtension(
    withConfig: MessagingPushConfigBuilder(cdpApiKey: "YOUR_CDP_API_KEY")
        .appGroupId("group.com.example.myapp.cio")
        .build()
)
```

App Group ID must match everywhere

The `.appGroupId()` value must be identical in your host app initialization, your NSE initialization, and the App Group entitlements on both targets. A mismatch prevents the SDK from accessing shared storage.

### Fallback behavior

If you omit `.appGroupId(...)`, the SDK attempts to infer the identifier using the convention `group.{bundleId}.cio`. This can work as a fallback, but we recommend explicitly passing the value to avoid configuration issues.

---

## Push > Deep links

**Source:** /integrations/sdk/ios/push/deep-links

# Deep links

Deep links let you open a specific page in your app instead of opening the device’s web browser. Want to open a screen in your app or perform an action when a push notification or in-app button is clicked? Deep links work great for this!

Setup deep linking in your app. There are two ways to do this; you can do both if you want.

*   **Universal Links**: universal links let you open your mobile app instead of a web browser when someone interacts with a *URL on your website*. For example: `https://your-social-media-app.com/profile?username=dana`—notice how this URL is the same format as a webpage.
*   **App scheme**: app scheme deep links are quick and easy to setup. Example of an app scheme deep link: `your-social-media-app://profile?username=dana`. Notice how this URL is *not* a URL that could show a webpage if your mobile app is not installed.

Universal Links provide a fallback for links if your audience doesn’t have your app installed, but they take longer to set up than *App Scheme* deep links. App Scheme links are easier to set up but won’t work if your audience doesn’t have your app installed.

## Set up Universal Links

To enable Universal Links in your iOS app, follow the instructions [on the Apple documentation website ↗](https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app). Be sure to complete all of the steps required including [making modifications to your website to host a new file ↗](https://developer.apple.com/documentation/Xcode/supporting-associated-domains) and [making modifications to your mobile app’s code to handle the deep link ↗](https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app).

Depending on how you set up your mobile app (SwiftUI, UIKit, watchOS, etc), you may need to [handle deep links in multiple functions ↗](https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app) in your code.

### Handling deep links on push notification click

Our SDK automatically handles deep links for Customer.io push notifications, calling The SDK’s calls `UIApplication.shared.open()` for the deep link URL by default. You don’t need to process deep links yourself in `userNotificationCenter(:didReceive:withCompletionHandler)`.

But, if you want to control URL handling and open specific screens in your app, you should implement the `application(:continue:restorationHandler:)` method in your AppDelegate.

Adopting UIScene or building with Xcode 27?

The AppDelegate methods on this page remain the no-change path for apps that use an app-delegate lifecycle. If your app adopts `UIScene` (or is built with the iOS 27 SDK and runs on iOS 27 or later), universal-link and URL handling moves to your `UISceneDelegate`. See [Handle deep links in a UIScene app](#uiscene-deep-links) below, and the [iOS 27 UIScene migration guide](/integrations/sdk/ios/whats-new/ios-27-uiscene-migration/) for the full cross-SDK walkthrough.

```
class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(
      _ application: UIApplication, 
      continue userActivity: NSUserActivity, 
      restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
    ) -> Bool {
        guard let universalLinkUrl = userActivity.webpageURL else {
            return false
        }

        // Parse `universalLinkUrl` object to perform the action you want in your app. 

        // return true from this function if your app handled the deep link. 
        // return false from this function if your app did not handle the deep link and you want sdk to open the URL in a browser.
    }
}
```

#### Deep link issue with calling `application(:continue:restorationHandler:)`

Some 3rd party SDKs might block calls to the `application(:continue:restorationHandler:)` method. If you encounter this problem, you can use an alternative approach to receive callbacks when your audience clicks notifications with deep links.

```
@main
// Add the CioAppDelegateWrapper to handle push notifications and device token registration
class AppDelegateWithCioIntegration: CioAppDelegateWrapper<AppDelegate> {}

class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.

        // Step 2: initialize the SDK 
        var cdpApiKey = YOUR_CDP_API_KEY
        var siteId = YOUR_SITE_ID
        
        let config = SDKConfigBuilder(cdpApiKey: cdpApiKey)
            .deepLinkCallback { (url: URL) in
                // You can call any method to process this further,
                // or redirect it to `application(_:continue:restorationHandler:)` for consistency, if you are already using it
                let openLinkInHostAppActivity = NSUserActivity(activityType: NSUserActivityTypeBrowsingWeb)
                openLinkInHostAppActivity.webpageURL = url
                return self.application(UIApplication.shared, continue: openLinkInHostAppActivity, restorationHandler: { _ in })
            }

        CustomerIO.initialize(withConfig: config.build())

        // Step 3: Initialize the in-app package
        // Before iOS SDK 4.12.0, use MessagingInAppConfigBuilder(siteId: siteId, region: .US), and use .EU if your account is in our EU data center.
        MessagingInApp.initialize(withConfig: MessagingInAppConfigBuilder(siteId: siteId).build())

        // Step 4: Initialize the push package    
        MessagingPushAPN.initialize(withConfig: MessagingPushConfigBuilder().build())

        return true
    }
}   
```

Check universal links using your Notes app

Try creating a note with a universal link and tapping the link to double-check that the link opens in your app and not in a browser window. This is an easy way to make sure that you’ve set up universal links correctly.

If your links are opening Safari instead of your app, [check this Apple document to troubleshoot ↗](https://developer.apple.com/documentation/technotes/tn3155-debugging-universal-links).

## Handle deep links in a UIScene app

If your app adopts `UIScene`, or you build it with the iOS 27 SDK and run it on iOS 27 or later, the system delivers URLs and universal links to your `UISceneDelegate` instead of your AppDelegate. The AppDelegate methods above still apply to app-delegate-lifecycle apps and need no change.

Keep `CustomerIO.initialize`, APNs registration, and `UNUserNotificationCenter` handling in your AppDelegate. Your app still owns the scene manifest, the SceneDelegate, the root window, and the final navigation. Customer.io does not add a SceneDelegate or choose which of your windows opens a URL.

### Route Customer.io destinations with a deep-link callback

Under `UIScene`, iOS delivers universal links to `scene(_:continue:)` instead of your AppDelegate. The SDK’s own fallback still calls `application(_:continue:restorationHandler:)` directly for `http` and `https` destinations, but it cannot deliver a URL to your SceneDelegate. Configure the callback below to keep scene-based routing under your control.

To keep in-app routing, configure `SDKConfigBuilder.deepLinkCallback` where you initialize the SDK in your AppDelegate. Return `true` when your app takes ownership of the URL. Return `false` to let the SDK try the legacy AppDelegate continuation callback and then open the URL through the system if the AppDelegate doesn’t handle it. Make the ownership decision synchronously and dispatch UI work to the main thread when your router requires it.

```
let config = SDKConfigBuilder(cdpApiKey: cdpApiKey)
    .autoTrackDeviceAttributes(true)
    .autoTrackUIKitScreenViews()
    .migrationSiteId(siteId)
    // Customer.io hands its own deep-link destinations to your app here.
    .deepLinkCallback { url in
        guard canHandleDeepLink(url) else { return false }

        DispatchQueue.main.async {
            handleDeepLink(url)
        }
        return true
    }

CustomerIO.initialize(withConfig: config.build())
```

Apps that don’t use Customer.io deep-link destinations, or that intentionally accept the fallback behavior, don’t need a callback.

### Handle URLs and universal links in your SceneDelegate

Your SceneDelegate owns the URLs the system delivers to the scene. Handle cold launches from `scene(_:willConnectTo:options:)` and warm opens from `scene(_:openURLContexts:)` (app-scheme URLs) and `scene(_:continue:)` (universal links).

```
import UIKit

class SceneDelegate: UIResponder, UIWindowSceneDelegate {
    var window: UIWindow?

    func scene(_ scene: UIScene, willConnectTo session: UISceneSession,
               options connectionOptions: UIScene.ConnectionOptions) {
        guard let windowScene = (scene as? UIWindowScene) else { return }
        window = UIWindow(windowScene: windowScene)
        // Set up your root view controller, then window?.makeKeyAndVisible().

        // Cold launch: a tap that opened the app with a URL arrives here...
        handle(urlContexts: connectionOptions.urlContexts)
        // ...and cold-launch universal links arrive as user activities.
        handle(userActivities: connectionOptions.userActivities)
    }

    // Warm app: app-scheme URLs opened while the scene is connected.
    func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
        handle(urlContexts: URLContexts)
    }

    // Warm app: universal links opened while the scene is connected.
    func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
        handle(userActivities: [userActivity])
    }

    private func handle(urlContexts: Set<UIOpenURLContext>) {
        for context in urlContexts {
            // Route context.url into your app's navigation.
        }
    }

    private func handle(userActivities: Set<NSUserActivity>) {
        for activity in userActivities {
            guard let url = activity.webpageURL else { continue }
            // Route the universal link into your app's navigation.
        }
    }
}
```

Handle app-scheme URLs and universal-link user activities independently, as shown. App-scheme URLs come through URL contexts, and universal links come through user activities.

Live Activities need one extra step

If you installed the separate Live Activities package, pass each opened URL through `CustomerIO.liveActivities.handleWidgetUrl(_:)` before you route it, so the tap is attributed to the exact delivery. See [Set up Live Activities](/integrations/sdk/ios/live-activities/set-up/#uiscene-live-activities).

## Setup App Scheme Deep Links

1.  Open your Xcode project and go to your project’s settings. Select your app **Target**, click the **Info** tab, and then click **URL Types** > to create a new URL Type. ![visual of the typed instructions in the sentence above to create a new URL type](https://customer.io/images/xcode_appscheme_urltypes.jpeg)
    
2.  Enter a unique value for your app for URL Schemes. ![visual of the typed instructions in the sentence above to enter a unique value for URL scheme](https://customer.io/images/xcode_appscheme_makeurltype.jpeg)

---

## Push > Provisional

**Source:** /integrations/sdk/ios/push/provisional

# Provisional push

Provisional push support is available for iOS 15 and above. Customer.io doesn’t have a specific “provisional push” feature. This is just something that iOS supports out of the box with iOS 15+. See Apple’s [provisional authorization documentation ↗](https://developer.apple.com/documentation/usernotifications/unauthorizationoptions/provisional) to learn more.

When you request authorization for push notifications, you can include the `.provisional` option in the `requestAuthorization` call.

```
class NotificationUtil: NotificationUtility {
    func showPromptForPushPermission(completionHandler: @escaping (Bool) -> Void) {
        UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound, .provisional], completionHandler: { status, _ in
            completionHandler(status)
        })
    }
}
```

---

## Push > Push certificates

**Source:** /integrations/sdk/ios/push/push-certificates

# Push service certificates

You can send push notifications to iOS devices using either [Apple’s Push Notification service (APNs) ↗](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification) or Google’s Firebase Cloud Messaging (FCM) service.

To authorize your Customer.io workspace to send notifications through APNs, you’ll need to upload your APNs `.p8` certificate and provide your credentials or upload your .JSON to iOS devices over Apple’s Push Notification service, you’ll need to upload your APNs `.p8` certificate and enter your Apple Developer *Key ID*, *Team ID*, and *Bundle ID*.

## Upload your push certificate

If you don’t already have your [`.p8` certificate for APNs](#get-your-p8-file-for-apns) or your [`.JSON` file for FCM](#get-your-json-file-for-fcm), you’ll need to get one before you can finish this process and send push notifications.

APNsFCM

#### APNs

1.  In Customer.io, go to [\> *Workspace Settings* > *Push*.](https://fly.customer.io/workspaces/last/settings/actions/apps).
    
2.  Click **Add app** and give your app a name—or click an existing app to add a platform to it.
    
3.  Select the *iOS* platform, and choose *Apple Push Notification Service*.
    
4.  Click **Choose file…**, and upload your `.p8` certificate.
    
5.  Enter your *Key ID*, *Team ID*, and *Bundle ID*. You can find these in your [Apple Developer Account ↗](https://developer.apple.com/).
    
6.  (Optional) Enable the *Send all push notifications to sandbox* option.
    
    Your iOS certificate may have both sandbox and production environments; this option sends push notifications to both environments.
    
     ![image.png](https://customer.io/images/image(320).png) 
    
    Note
    
    We recommend [creating a separate workspace](/messaging/channels/push/qa-testing/#testing-push-notifications) for your sandbox environment.
    
7.  Click **Save**.
    

 ![Push Settings - iOS_provider (APNs)](https://customer.io/images/push_settings_ios_provider_APNs.png)

#### FCM

1.  In Customer.io, go to [\> *Workspace Settings* > *Push*.](https://fly.customer.io/workspaces/last/settings/actions/apps).
    
2.  Click **Add app** and give your app a name—or click an existing app to add a platform to it.
    
3.  Select the *iOS* platform, and choose *Firebase Cloud Messaging (FCM)*. An app’s iOS and Android platforms can share a single FCM credential.
    

 ![Push Settings - iOS_provider (FCM)](https://customer.io/images/push_settings_ios_provider.png) 

## Get your .p8 file for APNs

1.  Log into your Apple Developer account and go to **[Certificates, Identifiers & People > Keys ↗](https://developer.apple.com/account/resources/authkeys)**. Click the blue button to create a new key.
2.  Click **Apple Push Notifications service (APNs)** and enter a name for the key.
3.  Click **Continue** and then **Register** to create the key.
4.  Download your keys and put it somewhere you’ll remember. You can only download your key once!

## Get your .JSON file for FCM

Before you can get a push certificate for Firebase Cloud Messaging, make sure that the FCM API is enabled for your project. You can [check that here ↗](https://console.developers.google.com/apis/api/fcm.googleapis.com/overview).

1.  Log into the Firebase Console for your project.
    
2.  Click in the sidebar and go to **Project settings**.
    
    ![Access your project settings in firebase](https://customer.io/images/project-settings.png)
    
3.  Go to **Service Accounts** and click **Generate New Private Key**. Confirm your choice and download the credential file.
    
    ![Generate a new private key in Firebase](https://customer.io/images/generate-key.png)

---

## Push > Push metrics

**Source:** /integrations/sdk/ios/push/push-metrics

# Push metrics

Customer.io supports device-side metrics that help you determine the efficacy of your push notifications: `delivered` when a push notification is received by the app and `opened` when a push notification is clicked.

Improve delivery metric reliability

Configure [App Groups](/integrations/sdk/ios/push/app-groups/) to make sure delivery metrics aren’t lost when iOS terminates the Notification Service Extension before the tracking request completes. With App Groups, the SDK automatically recovers any undelivered metrics on the next app launch.

If you already [added the Notification Service Extension](/integrations/sdk/ios/push/push-setup/#notification-service-extension) to your app, the SDK will automatically track `opened` and `delivered` events for push notifications originating from Customer.io. Without the extension, the SDK tracks `opened` but not `delivered`. See section [*Automatic push handling*](#automatic-push-handling) below to learn more about this great feature and how to best take advantage of it.

Otherwise, you can:

*   [Record push metrics with `UserNotifications`](#metrics-userNotifications).
*   [Extract delivery ID and Delivery Token parameters directly](#metrics-direct).

## Automatic push handling

After you call `MessagingPushAPN.initialize` or `MessagingPushFCM.initialize` in your `AppDelegate` and set up the `CioAppDelegateWrapper`, your app is ready to automatically handle push notifications that originate from Customer.io. No additional code is required for your app to track `opened` push metrics or launch deep links.

Do you use multiple push services in your app?

The Customer.io SDK only handles push notifications that originate from Customer.io. Push notifications that were sent from other push services or displayed locally on device are not handled by the Customer.io SDK. You must add custom handling logic to your app to handle those push events.

#### Configure push behavior

Configure push notification behavior using the `MessagingPushConfigBuilder`:

```
MessagingPushAPN.initialize(
    withConfig: MessagingPushConfigBuilder()
        .autoFetchDeviceToken(true)    // Automatically fetch device token and upload to CustomerIO
        .autoTrackPushEvents(true)     // Automatically track push metrics
        .showPushAppInForeground(true) // Enable Notifications in the foreground
        .build()
)
```

#### Configure push display behavior while app in foreground

If your app is in the foreground and receives a push notification, Customer.io will show the notification based on the value of the `showPushAppInForeground` configuration property.

You can choose whether or not to display push notifications when your app is foregrounded by implementing the `userNotificationCenter(_:didReceive:withCompletionHandler:)` method in your AppDelegate. Note that when you implement `UNUserNotificationCenterDelegate`, it takes priority over the `showPushAppInForeground` configuration property.

Add the highlighted code to your `AppDelegate.swift` file for custom handling:

```
class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(
      _ application: UIApplication,
      didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
        // ... 

        // Set the AppDelegate as a delegate for push notification events: 
        UNUserNotificationCenter.current().delegate = self

        return true
    }
}

extension AppDelegate: UNUserNotificationCenterDelegate {
    // Function called when a push notification arrives while app is in foreground
    func userNotificationCenter(
      _ center: UNUserNotificationCenter, 
      willPresent notification: UNNotification, 
      withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void
    ) {
        // To show it, return appropriate options for your case
        completionHandler([.banner, .list, .badge, .sound])

        // To hide it, return empty array
        // completionHandler([])
    }
}
```

#### Custom handling when a Customer.io push is clicked

Add the highlighted code to your `AppDelegate.swift` file if your app needs to perform custom handling when users click push notifications. For example, you’d need to perform custom handling if you need to process custom data that you attached to the push notification payload.

```
class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(
      _ application: UIApplication,
      didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
        // ... 

        // Set the AppDelegate as a delegate for push notification events: 
        UNUserNotificationCenter.current().delegate = self

        return true
    }
}

extension AppDelegate: UNUserNotificationCenterDelegate {
    // Function called when a push notification is clicked or swiped away.
    func userNotificationCenter(
      _ center: UNUserNotificationCenter,
      didReceive response: UNNotificationResponse,
      withCompletionHandler completionHandler: @escaping () -> Void
    ) {
        // If you need to know if a push was clicked: 
        let pushWasClicked = response.actionIdentifier == UNNotificationDefaultActionIdentifier

        // Process custom data attached to payload, if you need: 
        let pushPayload = response.notification.request.content.userInfo

        // Important: When you're done processing the push notification, you're required to call the completionHandler. 
        // Even if you do not process a push, you're still required to call the completionHandler() in this function. 
        completionHandler()
    }
}
```

#### Deep links handling when push is clicked

Our SDK handles deep links automatically for notifications originated from Customer.io. You can find more details at [Deep Links](/integrations/sdk/ios/push/deep-links/).

## Capture push metrics with `UserNotifications`

If you’re using a version of iOS that supports `UserNotifications`, you can track metrics using our `UNNotificationContent` helper.

```
func userNotificationCenter(
    _ center: UNUserNotificationCenter,
    didReceive response: UNNotificationResponse,
    withCompletionHandler completionHandler: @escaping () -> Void
) {
    // This 1 line of code might be all that you need!
    MessagingPush.shared.userNotificationCenter(center, didReceive: response, withCompletionHandler: completionHandler)

    // If you use `UserNotifications` for more then Customer.io push notifications, you can check 
    // if the SDK handled the push for you or not. 
    let handled = MessagingPush.shared.userNotificationCenter(center, didReceive: response, withCompletionHandler: completionHandler)
    if !handled {
        // Notification was *not* displayed by Customer.io. Handle the notification yourself. 
    }
}
```

## Extract delivery ID and token

If you’re not using a version of iOS that supports `UserNotifications`, you should send the push metric manually by extracting the `CIO-Delivery-ID` and `CIO-Delivery-Token` parameters directly to track push metrics.

```
guard let deliveryID: String = notificationContent.userInfo["CIO-Delivery-ID"] as? String, 
      let deviceToken: String = notificationContent.userInfo["CIO-Delivery-Token"] as? String else {
    // Not a push notification delivered by Customer.io
    return
}

MessagingPush.shared.trackMetric(deliveryID: deliveryID, event: .delivered, deviceToken: deviceToken)
```

## Disable automatic push tracking

Automatic push metric recording is enabled by default when you install the SDK. You can disable this behavior in the SDK’s configuration.

```
MessagingPushAPN.initialize(
    withConfig: MessagingPushConfigBuilder()
        .autoTrackPushEvents(false) // Disable automatic push tracking
        .build()
)
```

---

## Push > Push setup

**Source:** /integrations/sdk/ios/push/push-setup

# Set up push notifications

Our iOS SDK supports push notifications over APN or FCM. This page can help you get started with either service.

## Before you begin

This page explains how to register for push notifications using our SDK. But, before you can send push notifications, you need to add your push service credentials to Customer.io. See our [push service certificates](/integrations/sdk/ios/push/push-certificates/) to learn more.

If you haven’t already, you’ll need to install the push package for the push service you use, APNs or FCM, and enable the *Push Notifications* capability [in Xcode ↗](https://developer.apple.com/documentation/xcode/adding-capabilities-to-your-app). For FCM users, you’ll also need to install the `CioFirebaseWrapper` dependency. See our [quick start guide](/integrations/sdk/ios/quick-start-guide/) page for installation instructions.

Adopting UIScene or building with Xcode 27?

Keep initializing Customer.io, registering APNs tokens, and configuring notification handling in your AppDelegate as shown below. If your app adopts `UIScene`, see the [iOS 27 UIScene migration guide](/integrations/sdk/ios/whats-new/ios-27-uiscene-migration/) for the additional scene-lifecycle steps.

Send a copy of your push to the notification inbox

Sending a copy lets people read your message after they dismiss the push, or when their device can’t receive push notifications. To send a copy of a push notification to your inbox, check [**Add to Notification Inbox**](/messaging/channels/push/send-push/#add-to-notification-inbox) when you draft your push notification.

Before you can send a copy of a push notification to your inbox, you need to enable [in-app messaging](/messaging/channels/in-app/getting-started/), [set up and publish an inbox](/messaging/channels/in-app/inbox/get-started/), and add the inbox to your app. You can add our visual inbox, which includes a ready-made UI, or [build your own](/messaging/channels/in-app/inbox/advanced/overview/) and render the messages yourself.

## Register for push notifications

The instructions in this section set you up to receive push notifications and report them back to Customer.io. Complete all three steps. Step 3 adds the Notification Service Extension (NSE), which your app needs to report *Delivered* metrics for iOS push notifications. It also lets your app show images in [rich push notifications](/integrations/sdk/ios/push/rich-push/).

The SDK automatically handles push registration and push clicks for you. However, you’ll still need to identify users before you can send them push notifications.

### 1\. Initialize the push service

After you initialize the SDK, initialize the push service that you use in your app. Your code changes slightly depending on the push service you use.

APNsFCM

#### APNs

```
import CioDataPipelines
import CioMessagingPushAPN
import UIKit

@main
// Add the CioAppDelegateWrapper to handle push notifications and device token registration
class AppDelegateWithCioIntegration: CioAppDelegateWrapper<AppDelegate> {}

class AppDelegate: UIResponder, UIApplicationDelegate {
 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
     var cdpApiKey = YOUR_CDP_API_KEY
     var siteId = YOUR_SITE_ID
     
     let config = SDKConfigBuilder(cdpApiKey: cdpApiKey)
         .autoTrackDeviceAttributes(true)
         .autoTrackUIKitScreenViews()
         .migrationSiteId(siteId)

     CustomerIO.initialize(withConfig: config.build())

     // Initialize messaging features after initializing Customer.io SDK        
     MessagingPushAPN.initialize(
         withConfig: MessagingPushConfigBuilder()
             // optionally, configure the push module by calling functions on the builder. Such as: 
             .autoFetchDeviceToken(true)
             // See section below to find all the configuration options you can set. 
             .build()
     )

     return true
 }
} 
```

#### FCM

```
import CioDataPipelines
import CioFirebaseWrapper
import CioMessagingPushFCM
import FirebaseCore
import FirebaseMessaging
import Foundation
import UIKit

@main
// Add the CioAppDelegateWrapper to handle push notifications and device token registration
class AppDelegateWithCioIntegration: CioAppDelegateWrapper<AppDelegate> {}

class AppDelegate: NSObject, UIApplicationDelegate {
 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
     // FCM provides a device token to the app that
     // you send to the Customer.io SDK.

     // Initialize the Firebase SDK.
     FirebaseApp.configure()

     let siteId = YOUR_SITE_ID
     let cdpApiKey = YOUR_CDP_API_KEY

     // Configure and initialize the Customer.io SDK
     let config = SDKConfigBuilder(cdpApiKey: cdpApiKey)
         .migrationSiteId(siteId)
         .autoTrackUIKitScreenViews()
         .autoTrackDeviceAttributes(true)

     CustomerIO.initialize(withConfig: config.build())

     // Initialize messaging features after initializing Customer.io SDK        
     MessagingPushFCM.initialize(
         withConfig: MessagingPushConfigBuilder()
             // optionally, configure the push module by calling functions on the builder. Such as: 
             .autoFetchDeviceToken(true)
             // See section below to find all the configuration options you can set. 
             .build()
     )

     return true
 }
}
```

If you use FCM, you can [migrate to Firebase Installation IDs](/integrations/sdk/ios/whats-new/fid-migration/), Firebase’s newer kind of device ID.

### 2\. Identify your audience

[Identify the person](/integrations/sdk/ios/tracking/identify/) if you have not already. Even after you add a device token, you can’t use it until you associate it with a person.

```
CustomerIO.shared.identify(userId: "989388339", traits: ["first_name": firstName]) 
```

When you identify a person, you should see their device token in your workspace. If you don’t see a device token, see [Troubleshoot a missing device token](#missing-device-token).

Note that when you [identify a different person](/integrations/sdk/ios/tracking/identify/) or [stop identifying a person](/integrations/sdk/ios/tracking/identify/#clearIdentify), the SDK automatically removes the device token from any previously identified person. This ensures that a device token is only registered to the *currently identified person* in the SDK and prevents you from sending duplicate messages messaging the wrong person.

### 3\. Add a Notification Service Extension

Your app reports *Delivered* for iOS push notifications from a Notification Service Extension (NSE). If you skip this step, your iOS messages don’t report *Delivered* unless you [report delivery yourself](/integrations/sdk/ios/push/push-metrics/#metrics-direct). Your app still reports *Opened* when people tap a notification. A test push still appears on your device, so you might not notice the gap until you check your metrics. See [iOS delivery reporting](/messaging/channels/push/notifications-tracking/#ios-delivery-reporting) for how this affects your numbers.

1.  [Add a Notification Service Extension target to your project in Xcode ↗](https://developer.apple.com/documentation/usernotifications/modifying_content_in_newly_delivered_notifications). In the **Embed in Application** dropdown, select your app. Then, under the extension’s *General* tab, set **Deployment Target** to the same iOS version as your app.
    
2.  Add the Customer.io push package to the extension target. The extension is a separate target, so it can’t use the packages you added to your app.
    
    *   **Swift Package Manager**: Select your extension target. Under *General* > *Frameworks and Libraries*, click **+** and add `MessagingPushAPN` or `MessagingPushFCM`.
    *   **CocoaPods**: Add a target block for your extension to your Podfile, then run `pod install`. Use the target name you gave your extension in Xcode.
        
        ```
        target 'NotificationServiceExtension' do
          pod 'CustomerIO/MessagingPushAPN'  # or 'CustomerIO/MessagingPushFCM' if you use FCM
        end
        ```
        
3.  Replace the contents of the `NotificationService` file that Xcode created with the code for your push service.
    
    Xcode 16.3+ users
    
    If you encounter errors like “not available due to missing import of defining module ‘CioMessagingPush’”, go to your extension target’s *Build Settings* and set **Member Import Visibility** (`SWIFT_MEMBER_IMPORT_VISIBILITY`) to “Package” or disable it.
    
    APNsFCM
    
    #### APNs
    
    ```
    import CioMessagingPushAPN
    import UserNotifications
    
    class NotificationService: UNNotificationServiceExtension {
        override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
            MessagingPushAPN.initializeForExtension(
                withConfig: MessagingPushConfigBuilder(cdpApiKey: "YOUR_CDP_API_KEY")
                    // Optional: specify the region where your Customer.io account is located (.US or .EU). Default: US
                    .region(.US)
                    // Optional: set an App Group ID for reliable push delivery tracking
                    // .appGroupId("group.com.example.myapp.cio")
                    .build()
            )
    
            MessagingPush.shared.didReceive(request, withContentHandler: contentHandler)
        }
    
        override func serviceExtensionTimeWillExpire() {
            MessagingPush.shared.serviceExtensionTimeWillExpire()
        }
    }
    ```
    
    #### FCM
    
    ```
    import CioMessagingPushFCM
    import UserNotifications
    
    class NotificationService: UNNotificationServiceExtension {
        override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
            MessagingPushFCM.initializeForExtension(
                withConfig: MessagingPushConfigBuilder(cdpApiKey: "YOUR_CDP_API_KEY")
                    // Optional: specify the region where your Customer.io account is located (.US or .EU). Default: US
                    .region(.US)
                    // Optional: set an App Group ID for reliable push delivery tracking
                    // .appGroupId("group.com.example.myapp.cio")
                    .build()
            )
    
            MessagingPush.shared.didReceive(request, withContentHandler: contentHandler)
        }
    
        override func serviceExtensionTimeWillExpire() {
            MessagingPush.shared.serviceExtensionTimeWillExpire()
        }
    }
    ```
    

If Customer.io isn’t your only push provider, or you want to add features like action buttons, see [rich push](/integrations/sdk/ios/push/rich-push/) for code that handles those cases.

After you add the NSE, check that your messages report *Delivered*. Send a broadcast or automation message to your own profile, and check that message for *Delivered*. Test sends from the composer or *Workspace settings* might not create delivery metrics, so they can’t confirm that delivery tracking works. If your message arrives but doesn’t report *Delivered*, see [Problems with rich push notifications](/integrations/sdk/ios/getting-started/troubleshooting/#problems-with-rich-push-notifications-images-delivered-metrics-etc) and confirm that your extension’s **Deployment Target** matches your app’s.

## Push configuration options

When you initialize your preferred push package (`CioMessagingPushAPN` or `CioMessagingPushFCM`), you can pass configuration options determining how the push package functions.

Option

Type

Default

Description

`autoFetchDeviceToken`

boolean

`true`

When `true`, the package automatically fetches the device token for push notifications.

`autoTrackPushEvents`

boolean

`true`

Automatically track `opened` and `delivered` metrics based on push notifications.

`showPushAppInForeground`

boolean

`true`

Show push notifications when the app is in the foreground. Used only if customer’s AppDelegate doesn’t implement `UNUserNotificationCenterDelegate`.

`appGroupId`

String

`nil`

Sets the App Group identifier for reliable push delivery tracking. When set, the SDK stores undelivered metrics in shared storage so they can be recovered on the next app launch. See [App Groups for push tracking](/integrations/sdk/ios/push/app-groups/) for setup instructions.

## Troubleshoot a missing device token

If your app never receives device tokens, verify the following things in your app, in the order described below. If you use FCM, work through all four: the SDK gets an APNs token first and hands it to Firebase, so you can have a working APNs token and still have no FCM token.

1.  Confirm that your app target’s `.entitlements` file contains the `aps-environment` key, set to `development` or `production`. Xcode adds this key when it manages your entitlements. In projects where you keep a hand-maintained entitlements file in source control (React Native, Flutter, Expo prebuild, CI builds, manual signing), the key can go missing. Without it, the SDK doesn’t receive tokens. When `CioAppDelegateWrapper` is your app delegate, the SDK logs the registration failure; otherwise, your logs may not show why.
2.  Confirm that your provisioning profile includes the *Push Notifications* capability, not just your Xcode project.
3.  Confirm that `CioAppDelegateWrapper` is your app delegate and that you initialize `MessagingPushAPN` or `MessagingPushFCM` after you initialize the SDK. The SDK calls `registerForRemoteNotifications()` for you as long as you leave `autoFetchDeviceToken` at its default of `true`. If you set it to `false`, your app has to call `registerForRemoteNotifications()` itself and hand the token to `MessagingPush.shared.registerDeviceToken`.
4.  If you use FCM and your app has an APNs token but no FCM token, confirm that you call `FirebaseApp.configure()` before you initialize `MessagingPushFCM`. The SDK passes the APNs token to Firebase and waits for Firebase to return an FCM token. When the Firebase wrapper isn’t initialized, the SDK logs `firebaseService is nil` and never gets that far.

## Next steps

To make delivery tracking more reliable, set up [App Groups](/integrations/sdk/ios/push/app-groups/). iOS can end the Notification Service Extension before it finishes reporting a delivery. With App Groups, the SDK sends those deliveries the next time someone opens your app.

To send images and deep links in push notifications, or to use another push service alongside Customer.io, see [rich push](/integrations/sdk/ios/push/rich-push/).

---

## Push > Rich push

**Source:** /integrations/sdk/ios/push/rich-push

# Set up rich push

Set up your app to support push notifications with images and deep links.

Rich push notifications use a Notification Service Extension (NSE). Your app also needs the NSE to report *Delivered* metrics for iOS push notifications, whether or not you send images. If you followed the [push setup steps](/integrations/sdk/ios/push/push-setup/#notification-service-extension), you already added one. This page covers the extension in more detail, including setups with multiple push services or a custom completion handler.

## 1\. Add a service extension to your project

[Add a Service App Extension to your project in Xcode ↗](https://developer.apple.com/documentation/usernotifications/modifying_content_in_newly_delivered_notifications).

You should now see a new file added to your Xcode project. The file is probably named `NotificationService` and looks similar to this.

```
import UserNotifications
   
class NotificationService: UNNotificationServiceExtension {
   
    override func didReceive(
        _ request: UNNotificationRequest,
        withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void
    ) {
   
    }
   
    override func serviceExtensionTimeWillExpire() {
   
    }
}
```

## 2\. Update the service extension

Xcode 16.3+ users

If you encounter errors like “not available due to missing import of defining module ‘CioMessagingPush’”, go to your NotificationServiceExtension target’s **Build Settings** and set **Member Import Visibility** (`SWIFT_MEMBER_IMPORT_VISIBILITY`) to “Package” or disable it.

Modify your new `NotificationService` extension by selecting the push package you want to import and calling the appropriate Customer.io functions. Your code changes if:

*   Customer.io is your only push/rich push provider
*   Customer.io **is not** your only provider
*   You want to take advantage of push features outside the Customer.io, like action buttons; in this case, you’ll need to set your own completion handler.

App Groups for delivery tracking

The code samples below include a commented-out `.appGroupId()` line. To improve push delivery metric reliability, [set up App Groups](/integrations/sdk/ios/push/app-groups/) and enable that line with your App Group identifier.

Customer.io push onlyMultiple push servicesCustom completion handler

#### Customer.io push only

```
// Keep the import for your push provider—FCM or APN, and
// remove the other import statement
import CioMessagingPushAPN 
import CioMessagingPushFCM 
import UserNotifications

class NotificationService: UNNotificationServiceExtension {
    override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
       // Use `MessagingPushFCM` if you are using FCM as push service provider
       MessagingPushAPN.initializeForExtension(
            withConfig: MessagingPushConfigBuilder(cdpApiKey: "YOUR_CDP_API_KEY")
                // Optional: specify region where your Customer.io account is located (.US or .EU). Default: US
                .region(.US)
                // Optional: set App Group ID for reliable push delivery tracking
                // .appGroupId("group.com.example.myapp.cio")
                .build()
       )

       MessagingPush.shared.didReceive(request, withContentHandler: contentHandler)
    }

    override func serviceExtensionTimeWillExpire() {
        MessagingPush.shared.serviceExtensionTimeWillExpire()
    }
}
```

#### Multiple push services

```
// Keep the import for your push provider—FCM or APN, and
// remove the other import statement
import CioMessagingPushFCM
import CioMessagingPushAPN
import UserNotifications
   
class NotificationService: UNNotificationServiceExtension {
   
    override func didReceive(
        _ request: UNNotificationRequest,
        withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void
    ) {
        // Due to the behavior of Notification Service Extensions in iOS, you need to 
        // initialize the Push Module in both your host app and in your Notification Service.         
        // The config builder also lets you you to configure the push module.
       // Use `MessagingPushFCM` if you use FCM as your push service provider
       MessagingPushAPN.initializeForExtension(
            withConfig: MessagingPushConfigBuilder(cdpApiKey: "YOUR_CDP_API_KEY")
                .autoTrackPushEvents(true)
                // Optional: specify region where your Customer.io account is located (.US or .EU). Default: US
                .region(.US)
                // Optional: set App Group ID for reliable push delivery tracking
                // .appGroupId("group.com.example.myapp.cio")
                .build()
       )

        // If you use a service other than Customer.io to send rich push,
        // you can check if the SDK handled the rich push for you. If it did not, you
        // know that the push was *not* sent by Customer.io and you can try another way.
        let handled = MessagingPush.shared.didReceive(request, withContentHandler: contentHandler)
        if !handled {
            // Rich push was *not* sent by Customer.io. Handle the rich push in another way.
        }
    }
   
    override func serviceExtensionTimeWillExpire() {
        MessagingPush.shared.serviceExtensionTimeWillExpire()
    }
}
```

#### Custom completion handler

```
// Keep the import for your push provider—FCM or APN, and
// remove the other import statement
import CioMessagingPushFCM
import CioMessagingPushAPN
import UserNotifications
import CioDataPipelines
   
class NotificationService: UNNotificationServiceExtension {
   
    override func didReceive(
        _ request: UNNotificationRequest,
        withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void
    ) {
        // Due to the behavior of Notification Service Extensions in iOS, you need to 
        // initialize the Push Module in both your host app and in your Notification Service.         
        // The config builder also lets you you to configure the push module.
        // Use `MessagingPushFCM` if you use FCM as your push service provider
       MessagingPushAPN.initializeForExtension(
            withConfig: MessagingPushConfigBuilder(cdpApiKey: "YOUR_CDP_API_KEY")
                .autoTrackPushEvents(true)
                // Optional: specify region where your Customer.io account is located (.US or .EU). Default: US
                .region(.US)
                // Optional: set App Group ID for reliable push delivery tracking
                // .appGroupId("group.com.example.myapp.cio")
                .build()
       )

        // If you need to add features, like showing action buttons in your push, 
        // you can set your own completion handler.
        MessagingPush.shared.didReceive(request) { notificationContent in
            if let mutableContent = notificationContent.mutableCopy() as? UNMutableNotificationContent {
                // Modify the push notification like adding action buttons!
            }
            contentHandler(notificationContent)
        }
    }
   
    override func serviceExtensionTimeWillExpire() {
        MessagingPush.shared.serviceExtensionTimeWillExpire()
    }
}
```

Your app can now display rich push notifications in your app, including images, etc. See [Deep Links](/integrations/sdk/ios/push/deep-links/) to enable deep links in your push notifications.

## Improve delivery metrics with App Groups

For the most reliable push delivery tracking, set up [App Groups for push tracking](/integrations/sdk/ios/push/app-groups/). App Groups let the SDK recover delivery metrics that iOS might otherwise discard when it terminates the Notification Service Extension. Without this setup, you may lose some delivery data.

---

## Push > Silent push

**Source:** /integrations/sdk/ios/push/silent-push

# Silent push

A silent push wakes your app in the background and hands it the data set on the message, without showing anything to the person. Use this page to set your app up to receive silent pushes.

## How it works

When you send a [silent push](/messaging/channels/push/silent-push/), iOS wakes your app in the background and calls your app delegate. The SDK reads the push, reports *Delivered* to Customer.io, and gives your code the key/value data set on the message. A silent push never shows anything, so the SDK never reports *Opened*.

Silent push needs version 5.2.0 or later of the iOS SDK. If you install the SDK with CocoaPods, use version 5.2.1 or later, because CocoaPods doesn’t have version 5.2.0 of the `CustomerIO` pod.

Customer.io sends silent pushes to every iOS device a message targets, and doesn’t check which SDK version the device uses. On a device with an older SDK version, nothing reads the data and nothing reports *Delivered*.

Silent pushes don’t need the person’s permission to show notifications. Your app still needs to register for remote notifications, which the SDK does for you when `autoFetchDeviceToken` is on.

## Set up silent push

1.  In Xcode, select your app target, go to *Signing & Capabilities*, add the **Background Modes** capability, and check **Remote notifications**. This adds `remote-notification` to `UIBackgroundModes` in your `Info.plist`. Without it, iOS doesn’t wake your app for a silent push.
    
2.  Initialize `MessagingPushAPN` or `MessagingPushFCM` in `application(_:didFinishLaunchingWithOptions:)` on every launch, as described in [set up push notifications](/integrations/sdk/ios/push/push-setup/). iOS can launch your app in the background just to deliver a silent push, and that launch needs the SDK too.
    
3.  To read the data, call `MessagingPush.shared.handleBackgroundPush(userInfo:)` from `application(_:didReceiveRemoteNotification:fetchCompletionHandler:)`. If you use `CioAppDelegateWrapper`, add this method to the `AppDelegate` class that the wrapper wraps. The code is the same for APNs and FCM.
    
    ```
    import CioMessagingPush
    import UIKit
    
    class AppDelegate: UIResponder, UIApplicationDelegate {
        func application(
            _ application: UIApplication,
            didReceiveRemoteNotification userInfo: [AnyHashable: Any],
            fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void
        ) {
            switch MessagingPush.shared.handleBackgroundPush(userInfo: userInfo) {
            case .received(let push):
                // push.data holds the keys and values set on the message.
                // Key your work on push.deliveryID: the same push can arrive more than once.
                refreshAccount(push.data, deliveryID: push.deliveryID) {
                    completionHandler(.newData)
                }
            case .unsupported:
                // A Customer.io silent push the SDK can't read, like one with a value that isn't text.
                completionHandler(.noData)
            case .notBackground:
                // Not a Customer.io silent push. Pass it to your other handlers, then call completionHandler.
                completionHandler(.noData)
            }
        }
    }
    ```
    

Your app owns the completion handler. Call it once, as soon as your work ends.

### How the SDK reports Delivered

When automatic push tracking (`autoTrackPushEvents`) is on, which is the default, the SDK reports *Delivered* for each silent push:

*   With `CioAppDelegateWrapper`, the SDK reports *Delivered* before your handler runs. It does this even if your app doesn’t implement `application(_:didReceiveRemoteNotification:fetchCompletionHandler:)`.
*   Without the wrapper, `handleBackgroundPush(userInfo:)` reports it.

The SDK reports each delivery once, even when both the wrapper and your call to `handleBackgroundPush(userInfo:)` see the same push. If you turn automatic push tracking off, `push.deliveryToken` is the device token you need to [report the delivery yourself](/integrations/sdk/ios/push/push-metrics/#metrics-direct).

### Firebase’s app delegate proxy

If you use FCM with `CioAppDelegateWrapper` and leave Firebase’s app delegate proxy on, which is Firebase’s default, your app needs GoogleUtilities 8.1.5 or later. With earlier versions, silent pushes never reach `CioAppDelegateWrapper`, so your app gets no data and the SDK doesn’t report *Delivered*. New installs get a version that works. If you use CocoaPods, run `pod update GoogleUtilities` to update an existing app. You can also set `FirebaseAppDelegateProxyEnabled` to `NO` in your `Info.plist`.

## What to plan for

Apple decides when to deliver a silent push, and doesn’t always deliver it:

*   **Time**: iOS gives your app about 30 seconds to handle a silent push. Apps that run long or use a lot of power get woken less often.
*   **Repeats**: The same push can arrive more than once. Use `push.deliveryID` to skip work you already did.
*   **Force-quit apps**: iOS doesn’t wake an app the person swiped away in the app switcher. Silent pushes reach the app again after the person opens it.
*   **Offline devices**: While a device is offline, Apple keeps only the newest push for your app, so an earlier silent push can be dropped. Treat each silent push as a signal to sync, and fetch anything you missed from your own backend.
*   **Throttling**: Apple treats silent pushes as low priority and can delay or drop them, like in Low Power Mode. Apple’s guidance is to send no more than two or three an hour.

---

## Push > Sound in push

**Source:** /integrations/sdk/ios/push/sound-in-push

# Sound in push notifications

When you send a notification, it can play an alert on your audience's device. The sound file must be bundled in your app, and you'll specify which sound you want to play in your notification payload.

When you send a push notification to iOS devices that uses our SDK, you can opt to send the *Default* system sound or no sound at all. If your audience’s phone is set to vibrate, or they’ve disabled sound permissions for your app, the *Default* setting will cause the device to vibrate rather than playing a sound.

In most cases, you should use the *Default* sound setting to make sure your audience hears (or feels) your message. But, before you send sound, you should understand:

1.  Your app needs permission from your users to play sounds. This is done by your app, not our SDKs. [Here’s an example from our iOS sample app ↗](https://github.com/customerio/customerio-ios/blob/main/Apps/APN-UIKit/APN%20UIKit/Util/NotificationUtil.swift#L12-L13) showing how to request sound permissions.
2.  iOS users can go into *System Settings* and disable sound permissions for your app. Enabling the *Default* setting doesn’t guarantee that your audience hears a sound when your message is delivered!

We don't support custom sounds yet

If you want to send a custom sound, you’ll need to handle it on your own, outside the SDK and use a custom payload when you set up your push notifications.

---

## Push > Test push

**Source:** /integrations/sdk/ios/push/test-push

# Test your push implementation

After you set up push notifications, you should send some test messages. You can send messages through the Customer.io push composer. If your app is set up to send more than the standard title, body, image, and link, you’ll need to send a [custom payload](/messaging/channels/push/custom-payloads/#getting-started-with-custom-payloads).

 ![The custom payload editor for a push notification](https://customer.io/images/push-custom-ios.png)

The payloads below represent what your app can expect to receive from Customer.io. If you use a custom payload, you’ll need to use the format(s) below to make sure that the SDK receives your message properly.

When testing, you should:

*   Set the `link` to the deep link URL that you want to open when your tester taps your notification.
*   Set the `image` to the URL of an image you want to show in your notification. It’s important that the image URL starts with `https://` and *not* `http://` or the image might not show up.

APNS payloadFCM payload

#### APNS payload

```
{
    "aps": {
        // basic iOS message and options go here
        "mutable-content": 1,
        "sound": "default",
        "alert": {
            "title": "string", //(optional) The title of the notification.
            "body": "string" //(optional) The message you want to send.
        }
    },
    "CIO": {
        "push": {
            "link": "string", //generally a deep link, i.e. my-app:://...
            "image": "string" //HTTPS URL of your image, including file extension
        }
    }
}
```

*   apsobject
    
    A push payload intended for an iOS device.
    
*   CIOobject
    
    Contains options supported by the Customer.io SDK.
    

#### FCM payload

```
{
  "message": {
    "apns": {
      "payload": {
        "aps": {
          // basic iOS message and options go here
          "mutable-content": 1,
          "sound": "default",
          "alert": {
            "title": "string", //(optional) The title of the notification.
            "body": "string" //(optional) The message you want to send.
           }
        },
        "CIO": {
          "push": {
            "link": "string", //generally a deep link, i.e. my-app://... or https://yourwebsite.com/...
            "image": "string" //HTTPS URL of your image, including file extension
          }
        }
      },
      "headers": {
        // (optional) headers to send to the Apple Push Notification Service.
        "apns-priority": 10
      }
    }
  }
}
```

*   messageobjectrequired
    
    The base object for all FCM payloads.
    
    *   apnsobjectrequired
        
        Defines a payload for iOS devices sent through Firebase Cloud Messaging (FCM).
        
        *   payloadobjectrequired
            
            Contains a push payload.
            
        *   headersobject
            
            Headers defined by [Apple's payload reference](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns) that you want to pass through FCM.
            

## Check delivery metrics

To check that Customer.io reports *Delivered*, send a broadcast or automation message to your own profile, and check that message for *Delivered*. Test sends from the composer or *Workspace settings* might not create delivery metrics, so they can’t confirm that delivery tracking works. Your app only reports *Delivered* for iOS push notifications if it includes a [Notification Service Extension (NSE)](/integrations/sdk/ios/push/push-setup/#notification-service-extension). A message can appear on your device without the NSE, so seeing the notification doesn’t confirm that delivery tracking works.

If your message appears but doesn’t report *Delivered*, see [iOS delivery reporting](/messaging/channels/push/notifications-tracking/#ios-delivery-reporting) and [Problems with rich push notifications](/integrations/sdk/ios/getting-started/troubleshooting/#problems-with-rich-push-notifications-images-delivered-metrics-etc).

---

## Tracking > Anonymous activity

**Source:** /integrations/sdk/ios/tracking/anonymous-activity

# Anonymous activity

Before you identify a person, calls you make to the SDK are associated with an `anonymousId`. When you identify that person, we reconcile their anonymous activity with the identified person.

In Customer.io, you’ll see anonymous activity in the *Activity Log*, but we don’t store anonymous activities on a [profile](/messaging/people/manage/overview/) until the person is identified by an email address or other ID. You won’t be able to find an “anonymous profile” in your workspace.

You can’t trigger automations or send messages like push notifications to anonymous users; however, if you’re on a premium or enterprise plan, you can send [anonymous in-app messages](/integrations/sdk/ios/in-app/set-up-in-app/#anonymous-messages).

When you identify a person, we merge anonymous activity with the identified person. And then the identified person’s previously anonymous activity *can* trigger automations and cause your audience to receive messages.

For example, imagine that you have an ecommerce app, and you want to message people who view a specific product. An anonymous user looks at the product in question, goes to a different page, and then logs into your app. When they log in, we merge their anonymous activity with their identified person, and their previously anonymous `screen` view triggers the automation you set up for people who visited the product page.

You can return a person’s anonymous ID at any time by calling `CustomerIO.shared.anonymousId`.

---

## Tracking > Geofencing

**Source:** /integrations/sdk/ios/tracking/geofencing

# Geofencing

## How it works

**Geofences** let you react when a person enters, stays in, or exits a real-world location—a store, a venue, a neighborhood. You define geofences in Customer.io. The SDK downloads them, monitors them on the device, and automatically sends `Geofence Transition` events to Customer.io when identified people enter, dwell in, or exit a geofence. You can use these events to trigger automation journeys and build segments, the same way you use any other event.

In Customer.io, you group geofences into **geofence sets**. A geofence set is a group of geofences that you act on together. For example, you might group all of your stores into a geofence set, and trigger an automation when a device enters any of the geofences in the set. Each `Geofence Transition` event includes both the geofence crossed and the geofence set it belongs to.

The SDK uses the operating system’s geofencing support so transitions can arrive while your app is in the background (subject to permissions).

Geofencing depends on the [Location module](/integrations/sdk/ios/tracking/location/), which supplies the device’s current location. This tells the SDK which geofences to monitor.

Event payloads exclude coordinates

For privacy, `Geofence Transition` events don’t include the person’s precise latitude and longitude—only whether they entered, dwelled in, or exited a geofence.

## Prerequisites

Geofencing requires:

*   The **Location module** (a required dependency). See [location tracking](/integrations/sdk/ios/tracking/location/).
*   The **Geofence module** (`CioLocationGeofence`).
*   Location permission from the person using your app.
*   Location services enabled on the device.

## Install the geofence module

Add the `CioLocation` and `CioLocationGeofence` packages to your project. Geofencing depends on the Location module, so add both. If you use Swift Package Manager, add them the same way you added the other Customer.io packages. They’re part of the [`customerio-ios` ↗](https://github.com/customerio/customerio-ios) package.

Swift Package ManagerCocoaPods

#### Swift Package Manager

```
.product(name: "Location", package: "customerio-ios")
.product(name: "LocationGeofence", package: "customerio-ios")
```

#### CocoaPods

```
pod 'CustomerIO/Location'
pod 'CustomerIO/LocationGeofence'
```

## Add location permissions

Add usage descriptions to your `Info.plist` so iOS can prompt the person for location access:

```
<key>NSLocationWhenInUseUsageDescription</key>
<string>We use your location to send you relevant, location-based messages.</string>

<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>We use your location to send you relevant, location-based messages.</string>
```

The SDK doesn’t request permission on its own. Request it at runtime with `CLLocationManager`:

```
import CoreLocation

let locationManager = CLLocationManager()

// When someone first reaches a feature that uses location
locationManager.requestWhenInUseAuthorization()

// Later, when background detection is worth asking for
locationManager.requestAlwaysAuthorization()
```

#### You want users to *Always* grant background location permissions

Your audience must set location authorization to **Always** for geofencing to work the way you probably expect it to. Without this permission—including when your audience has set it to **While Using the App**—your app can’t detect transitions while it’s closed or in the background; it’s unlikely that your audience has your app open and in the foreground when they pass through a geofence.

Authorization

What you get

Always

Full geofencing support. Geofence transitions arrive when the app is in the foreground, in the background, and whenever iOS relaunches your app. The SDK logs `Geofence background delivery active`.

While Using the App

Geofence transitions only arrive while your app is in the foreground. The SDK logs `Geofence registered for foreground delivery only`.

Denied, Restricted, or not yet asked

Geofencing is effectively disabled. The SDK skips registration and logs `Geofence registration skipped: location permission not granted`.

#### Requesting permissions

iOS doesn’t set the location authorization to **Always** from a single prompt, so you’ll want to plan your permission flow around it:

1.  Request *when-in-use* authorization the first time someone reaches a part of your app where location matters. Explain what they get in return—your `NSLocationWhenInUseUsageDescription` string is the only explanation that iOS shows.
2.  Request *always* authorization later, at a moment when the benefit is obvious—after someone saves a favorite store, or opts into arrival reminders. iOS shows the upgrade prompt on its own schedule, and it may ask the person again whether to keep allowing background location permissions after your app uses location features.

Don’t ask for both permissions when you first launch your app. A person who denies the prompt can only change their mind in **Settings**, and iOS won’t ask a second time.

You don’t need to tell the SDK when permission changes. It watches for authorization changes and registers geofences on its own when someone grants access—whether they answer a late prompt or change the setting in **Settings**.

If users turn off *precise location*, iOS can delay or miss transitions, especially for small geofences.

## Initialize the SDK with the geofence module

Register both `LocationModule` and `GeofenceModule` when you initialize the SDK. The Location module’s `mode` controls [location tracking](/integrations/sdk/ios/tracking/location/) only—it doesn’t affect geofencing. By default, the geofence module acquires the location it needs on its own, even when location tracking is off. See [location modes](#location-modes-and-monitoring) below.

```
import CioDataPipelines
import CioLocation
import CioLocationGeofence

let config = SDKConfigBuilder(cdpApiKey: "your-cdp-api-key")
    .addModule(LocationModule(config: LocationConfig(mode: .onAppStart)))
    .addModule(GeofenceModule())
    .build()

CustomerIO.initialize(withConfig: config)
```

Call `initialize` on the main thread.

## The Geofence Transition event

The SDK sends `Geofence Transition` events automatically when a person enters, dwells in, or exits a geofence. You don’t need to track these transitions yourself. The `transition` field in the event tells us whether someone entered, exited, or remained inside a geofence (`dwell`).

Every geofence belongs to at least one geofence set. When a person crosses a geofence, the SDK sends an event for each geofence set the geofence belongs to, each carrying that set’s `geosetId`.

The event’s timestamp is when the SDK detected the transition, and the SDK preserves it if delivery is delayed. So a transition captured while the device is offline still lands on the timeline at the moment it occurred.

Events for one visit can arrive late, out of order, or without their matching events, so don’t build automations that require an enter, a dwell, and an exit for every visit.

The properties in each event depend on its `transition` (`enter`, `dwell`, or `exit`). Choose a transition to see an example event and the properties the SDK sends with it.

EnterDwellExit

#### Enter

The SDK sends an enter `transition` when a person crosses into a geofence.

```
{
  "name": "Geofence Transition",
  "timestamp": "2026-07-06T17:42:10.482Z",
  "properties": {
    "transition": "enter",
    "geofenceId": "48122",
    "geofenceName": "Downtown flagship store",
    "geosetId": "25678",
    "transitionId": "b3f1c2a4-8e7d-4c2b-9f10-2a6f1e0d5c33",
    "metadata": {
      "region": "northeast",
      "priority": 2
    }
  }
}
```

*   geosetIdstringrequired
    
    Customer.io-generated ID of the geofence set. Every geofence belongs to at least one set, and the SDK sends one event for each set the geofence belongs to.
    
*   transitionstringrequired
    
    The person crossed into the geofence.
    
    Accepted values: `enter`
    
*   geofenceIdstring
    
    Customer.io-generated ID of the geofence. This is different from the `external_id` used for geofence imports.
    
*   geofenceNamestring
    
    The geofence's name. Included only when the geofence has one.
    
*   metadataobject
    
    The metadata you define on the geofence in Customer.io. Values keep their types—a numeric value arrives as a number, not a string. Metadata values must be JSON scalars (`string`, `number`, or `boolean`); the SDKs drop array and object values. If the geofence has no metadata, the property is an empty object.
    
    *   additional properties \*any type
        
*   transitionIdstring
    
    A unique ID for this transition. Events sent for different geofence sets share the same ID, and it stays stable if the SDK retries delivery. To de-duplicate transition events, use `transitionId` and `geosetId` together.
    

#### Dwell

The SDK sends a dwell `transition` when a person has stayed inside a geofence for its dwell time. In this example, the geofence’s dwell time is 10 minutes.

A **dwell** transition means the person stayed inside a geofence for a set amount of time, called the geofence’s [dwell time](/messaging/people/location/geofence-dwell-time/). The SDK sends a dwell `transition` only for geofences that have a dwell time, and it sends at most one dwell `transition` per visit.

Dwell events and visit durations start with Android SDK `4.26.0`, iOS SDK `4.13.0`, React Native `6.16.0`, Flutter `4.10.0`, and Expo plugin `3.14.0`. Older SDK versions only send enter and exit events, without visit properties.

```
{
  "name": "Geofence Transition",
  "timestamp": "2026-07-06T17:52:41.204Z",
  "properties": {
    "transition": "dwell",
    "geofenceId": "48122",
    "geofenceName": "Downtown flagship store",
    "geosetId": "25678",
    "transitionId": "e41c7a09-2b5d-4e8f-9c3a-6d1f0b8e2a54",
    "visitId": "e41c7a09-2b5d-4e8f-9c3a-6d1f0b8e2a54",
    "enteredAt": 1783359730,
    "dwellThresholdSeconds": 600,
    "dwellDurationSeconds": 631,
    "detectionSource": "native",
    "metadata": {
      "region": "northeast",
      "priority": 2
    }
  }
}
```

*   detectionSourcestringrequired
    
    How the SDK confirmed that the person is still inside the geofence. Use this property for troubleshooting; values vary by platform.
    
*   dwellThresholdSecondsintegerrequired
    
    The geofence's dwell time, in seconds, when the SDK confirmed the dwell.
    
*   geosetIdstringrequired
    
    Customer.io-generated ID of the geofence set. Every geofence belongs to at least one set, and the SDK sends one event for each set the geofence belongs to.
    
*   transitionstringrequired
    
    The person stayed inside the geofence for at least the geofence's dwell time. The SDK only sends one dwell event per visit.
    
    Accepted values: `dwell`
    
*   visitIdstringrequired
    
    An ID for the visit, from the time the person entered the geofence until they left. If the SDK sends an exit event for this visit, it carries the same `visitId`.
    
*   dwellDurationSecondsinteger
    
    Observed seconds inside the geofence when the SDK confirmed the dwell. This can exceed the dwell time if confirmation was delayed. Rounded up to whole seconds. Included only when the SDK observed the entry and can time the visit reliably.
    
*   enteredAtinteger
    
    When the person entered the geofence, as a Unix timestamp in seconds. Included only when the SDK knows when the person entered.
    
*   geofenceIdstring
    
    Customer.io-generated ID of the geofence. This is different from the `external_id` used for geofence imports.
    
*   geofenceNamestring
    
    The geofence's name. Included only when the geofence has one.
    
*   metadataobject
    
    The metadata you define on the geofence in Customer.io. Values keep their types—a numeric value arrives as a number, not a string. Metadata values must be JSON scalars (`string`, `number`, or `boolean`); the SDKs drop array and object values. If the geofence has no metadata, the property is an empty object.
    
    *   additional properties \*any type
        
*   transitionIdstring
    
    A unique ID for this transition. Events sent for different geofence sets share the same ID, and it stays stable if the SDK retries delivery. To de-duplicate transition events, use `transitionId` and `geosetId` together.
    

#### Exit

The SDK sends an exit `transition` when a person crosses out of a geofence. When the SDK can time the visit reliably, the exit includes `visitDurationSeconds`, measured from entry until it detects the exit. Detection can happen after departure; `visitDurationUncertaintySeconds` describes how much of that duration may be time after the person left. The SDK can also detect the entry after the person arrives, so the actual stay can begin before the recorded entry.

If the SDK didn’t observe the entry, or monitoring was interrupted, the exit omits the duration properties. The SDK tracks visit duration even when the geofence has no dwell time.

```
{
  "name": "Geofence Transition",
  "timestamp": "2026-07-06T18:05:41.117Z",
  "properties": {
    "transition": "exit",
    "geofenceId": "48122",
    "geofenceName": "Downtown flagship store",
    "geosetId": "25678",
    "transitionId": "7d2e9b10-4c61-4f3a-a8e5-0b9c3f6d2e71",
    "visitId": "e41c7a09-2b5d-4e8f-9c3a-6d1f0b8e2a54",
    "enteredAt": 1783359730,
    "visitDurationSeconds": 1411,
    "visitDurationUncertaintySeconds": 781,
    "detectionSource": "native",
    "metadata": {
      "region": "northeast",
      "priority": 2
    }
  }
}
```

*   geosetIdstringrequired
    
    Customer.io-generated ID of the geofence set. Every geofence belongs to at least one set, and the SDK sends one event for each set the geofence belongs to.
    
*   transitionstringrequired
    
    The person crossed out of the geofence.
    
    Accepted values: `exit`
    
*   detectionSourcestring
    
    How the SDK confirmed the exit. Use this property for troubleshooting; values vary by platform. Included only when the SDK tracked the visit.
    
*   enteredAtinteger
    
    When the visit began, as a Unix timestamp in seconds. Included only when the SDK observed the whole visit.
    
*   geofenceIdstring
    
    Customer.io-generated ID of the geofence. This is different from the `external_id` used for geofence imports.
    
*   geofenceNamestring
    
    The geofence's name. Included only when the geofence has one.
    
*   metadataobject
    
    The metadata you define on the geofence in Customer.io. Values keep their types—a numeric value arrives as a number, not a string. Metadata values must be JSON scalars (`string`, `number`, or `boolean`); the SDKs drop array and object values. If the geofence has no metadata, the property is an empty object.
    
    *   additional properties \*any type
        
*   transitionIdstring
    
    A unique ID for this transition. Events sent for different geofence sets share the same ID, and it stays stable if the SDK retries delivery. To de-duplicate transition events, use `transitionId` and `geosetId` together.
    
*   visitDurationSecondsinteger
    
    Seconds from when the SDK detected the entry until it detected the exit. Detection may happen after departure; see `visitDurationUncertaintySeconds`. The SDK can also detect the entry after the person arrives, so the actual stay can begin before the recorded entry. Rounded up to whole seconds. Included only when the SDK can time the visit reliably.
    
*   visitDurationUncertaintySecondsinteger
    
    How much of `visitDurationSeconds` may have elapsed after the person left, in seconds. Included only with a recorded duration; `0` means no additional uncertainty was recorded.
    
*   visitIdstring
    
    The ID of the visit this exit ends. A dwell event during the same visit carries the same `visitId`. Included only when the SDK tracked the visit.
    

## Location modes and monitoring

Devices can only monitor a limited number of geofences at once, so the SDK monitors the geofences nearest to the user, ranked by distance from the device’s location. The SDK automatically refreshes that set as the device moves. Geofence sets don’t affect monitoring—the SDK ranks individual geofences, and geofence set membership only determines the events it sends.

The geofence module needs a location fix to select that set. The `locationMode` in `GeofenceModuleConfig` controls how it gets one:

Location mode

Behavior

`.automatic` (default)

The SDK acquires a location fix on its own whenever geofencing needs one and none is already available—for example, when you identify a person.

`.manual`

The SDK doesn’t acquire location on its own. Call `CustomerIO.geofence.refreshFromCurrentLocation()` after you identify someone and they grant location permission.

```
.addModule(GeofenceModule(config: GeofenceModuleConfig(locationMode: .automatic)))
```

Location the SDK acquires for geofencing is used for geofencing only—it never produces a `Location Update` event or updates the person. It also works independently of the Location module’s tracking mode, even when location tracking is `.off`.

`refreshFromCurrentLocation()` works in either mode—call it any time you want to force an immediate refresh. Geofences are tied to the identified person, so in `.manual` mode call it after you identify someone; a refresh requested before you identify anyone isn’t retried automatically.

Neither mode limits detection to the moment the SDK acquires a location. Once the SDK registers geofences, iOS can wake your app near their boundaries, in the background and even between launches, without continuously tracking the person’s location.

The device won't see new geofences immediately.

Any changes you make to geofences or geofence sets in Customer.io won’t be available on the device until it fetches updates from Customer.io. This happens within 24 hours for an active app, or sooner if the person travels a long distance, or your app forces a refresh. See [Geofence refresh](#geofence-refresh).

### Circle and polygon monitoring

The operating system monitors circular geofences directly. For a polygon, the SDK registers the polygon’s enclosing circle with the operating system as a wake-up boundary and uses additional location readings to check movement into or out of the polygon boundary. Depending on the platform and device state, these checks can happen after an operating-system wake, when the app returns to the foreground, or as part of a recovery check.

Geofencing uses background location for background detection, not just for polygons. Because polygon monitoring can request additional location readings while your app is in the background, the operating system may show people a reminder that your app has used or can access their location in the background. The operating system controls the wording and timing of these reminders. Make sure your permission messaging clearly explains why your app needs background location. See Apple’s guidance for [requesting location authorization ↗](https://developer.apple.com/documentation/corelocation/requesting-authorization-to-use-location-services) and Android’s guidance for [requesting location permissions ↗](https://developer.android.com/develop/sensors-and-location/location/permissions).

You don’t need to change your SDK setup or event handling to use polygons. The same Geofence module monitors both shapes and sends the same `Geofence Transition` event.

Polygon support starts with Android SDK 4.22.0, iOS SDK 4.9.0, React Native 6.13.0, Flutter 4.7.0, and Expo plugin 3.11.0 with React Native 6.13.0. Older SDK versions continue to monitor circles, but they don’t receive polygons.

Because polygons require additional location checks, they may use more battery than circles. Background restrictions and location accuracy can delay polygon detection or cause missed enter and exit events. When a circle describes the location well, use a circle for more reliable monitoring with less battery use.

### Geofence refresh

The SDK re-downloads your geofence definitions from Customer.io—picking up any geofences you’ve added, changed, or removed, along with the geofence sets they belong to, when:

*   **Your app launches, or you identify a person**—at most once every 24 hours. Geofencing needs an identified person, so if no one is identified when your app launches, the fetch waits until you identify someone.
*   **The person travels a long distance** (about 5 km by default) from where the SDK last fetched.
*   **Your app forces a refresh** by calling `refreshFromCurrentLocation()`.

So changes you make in Customer.io aren’t instant. They reach a device the next time one of these happens—typically within a day for an app in regular use, but longer for an app no one opens.

### Duplicate event suppression

The SDK suppresses duplicate enter and exit events for the same geofence within 1 hour. If a device crosses into a geofence, out again, and then crosses back into the geofence within the next hour, the SDK drops the second entrance event.

## Limitations

*   The SDK doesn’t continuously track the person’s location.
*   Geofencing depends on operating-system callbacks.
*   Background delivery depends on platform permissions.
*   Geofencing needs the device’s location services. If location is turned off—for example, airplane mode with location disabled—iOS can’t detect crossings until location is available again. Delivery of already-captured transitions resumes when a network connection returns.
*   Mobile operating systems limit how many geofences an app can monitor at once. If your app uses geofencing from more than one source (for example, Customer.io and another SDK), all monitored geofences share the same operating-system limit. The Customer.io SDK manages its own geofences within that limit, but it can’t control geofences registered by other SDKs or by your app.

---

## Tracking > Identify

**Source:** /integrations/sdk/ios/tracking/identify

# Identify people

You need to identify a user before you can send them messages or track the things they do in your app. You need the **CioDataPipelines** package to identify people.

## Identify a person

Identifying a person:

1.  Adds or updates the person in your workspace. This is basically the same as an [`identify` call to our server-side API](/integrations/api/track/tag/track-customers/identify/).
2.  Saves the person's information on the device. Future calls to the SDK reference the identified person. For example, after you identify a person, any events that you track are automatically associated with that person.
3.  If you already registered a device token, identifying a person automatically associates the token with the identified person. You can register for a device token before or after you identify a person. See our [Push Documentation](/integrations/sdk/ios/push/push-setup/) for help registering device tokens.

You can only identify one customer at a time. The SDK "remembers" the most recently-identified customer. If you identify person A, and then call the identify function for person B, the SDK "forgets" person A and assumes that person B is the current app user. You can also [stop identifying a person](#clearIdentify), which you might do when someone logs off or stops using your app for a significant period of time.

An identify request takes the following parameters:

*   **userId** (required): The unique value representing a person—an ID or email address that represents a person in Customer.io (and your downstream destinations). If you treat `phone` as an identifier, you should identify people by `id` or `email` and send the phone number as a `phone` attribute.
*   **traits** (Optional): Contains [attributes](/journeys/people/manage/attributes/) that you want to set for a person. /integrations/api/track/tag/track-customers/identify/

```
import CioDataPipelines

CustomerIO.shared.identify(userId: "989388339", traits: ["first_name": firstName]) 

// `traits` accepts [String: Any] or an `Encodable` object 

// 1. [String: Any]:
let traits = ["first_name": "Dana", "last_name": "Green"]
CustomerIO.shared.identify(userId: "989388339", traits: traits)


// 2. `Encodable` object:
struct IdentifyRequestTraits: Encodable {
  let firstName: String
  let lastName: String 
}
CustomerIO.shared.identify(userId: "989388339", traits: IdentifyRequestTraits(firstName: "Dana", lastName: "Green"))
```

### Update a person’s attributes

You store information about a person in Customer.io as [attributes](/journeys/people/manage/attributes/) . When you call the `identify()` function, you can update a person’s attributes on the server-side.

If a person is already identified, and the user updates their preferences, provides additional information about themselves, or performs other attribute-changing actions, you can update their profile attributes with `profileAttributes`.

```
CustomerIO.shared.profileAttributes = ["favorite_food": "pizza"]
```

You only need to pass the attributes that you want to create or modify to `profileAttributes`. For example, if you identify a new person with the attribute `["first_name": "Dana"]`, and then you call `CustomerIO.shared.profileAttributes = ["favorite_food": "pizza"]` after that, the person’s `first_name` attribute will still be `Dana`.

### Device attributes

By default (if you don’t set `.autoTrackDeviceAttributes(false)` in your config), the SDK automatically collects a series of [attributes](/journeys/people/manage/attributes/) for each device. You can use these attributes in [segments](/journeys/segmentation/data-driven-segments/) and other automation workflow conditions to target the device owner, just like you would use a person’s other attributes. You cannot, however, use device attributes to personalize messages with [liquid](/journeys/liquid/using-liquid) yet.

Along with these attributes, we automatically set a `last_used` timestamp for each device indicating when the device owner was last identified, and the `last_status` of a push notification you sent to the device. You can also set your own custom device attributes. You’ll see a person’s devices and each device’s attributes when you go to **Journeys > People > Select a person**, and click **Devices**. You can store [up to 25 devices for each person](/messaging/channels/push/developer-guide/#identify-device-tokens). If a person already has 25 devices and you add another, you’ll remove the oldest device (determined by the `last_used` timestamp).

 ![device attributes on a person](https://customer.io/images/device-attributes.png)

Your integration shows device attributes in the `context` object

When you inspect calls from the SDK (in your integration’s data in tab), you’ll see device information in the `context` object. We flatten the device attributes that you send into your workspace, so that they’re easier to use in [segments](/journeys/segmentation/segments/) . For example, `context.network.cellular` becomes `network_cellular`.

*   idstringrequired
    
    The unique device identifier. This is an APNs token, an FCM registration token, or a [Firebase Installation ID (FID)](/messaging/channels/push/developer-guide/#device-ids).
    
*   platformstringrequired
    
    The device/messaging platform.
    
    Accepted values: `ios`, `android`
    
*   attributesobject
    
    Attributes that you can reference to segment your audience—like a person's attributes, but specific to a device. These can be either the attributes defined below or custom key-value attributes.
    
    *   \_last\_statusstring
        
        The delivery status of the last message sent to the device—sent, bounced, or suppressed. An empty string indicates that that the device hasn't received a push yet.
        
        Accepted values: , `bounced`, `sent`, `suppressed`
        
    *   app\_identifierstring
        
        The app that the device belongs to—the **Bundle ID / App identifier** you entered with that app's push credentials. If you have more than one app, we use this attribute to send push notifications to the right app. A device without an app identifier receives push notifications you send to your [default app](/messaging/channels/push/getting-started/#the-default-app).
        
    *   app\_versionstring
        
        The version of your app that a customer uses. You might target app versions to let people know when they need to update, or expose them to new features when they do.
        
    *   cio\_sdk\_versionstring
        
        The version of the Customer.io SDK in the app.
        
    *   device\_localestring
        
        The device's [IETF language code](/journeys/channels/localization/getting-started/#supported-languages), such as `en-MX` or `es-ES`.
        
    *   device\_modelstring
        
        The model of the device a person uses.
        
    *   device\_osstring
        
        The operating system, including the version, on the device.
        
    *   network\_bluetoothboolean
        
        If `true`, the device's bluetooth connection is on.
        
    *   network\_cellularboolean
        
        If `true`, the device's cellular connection is on.
        
    *   network\_wifiboolean
        
        If `true`, the device's WiFi connection is on.
        
    *   push\_enabledstring
        
        If `"true"`, the device is opted-in and can receive push notifications.
        
        Accepted values: `true`, `false`
        
    *   screen\_heightinteger
        
        The height of the device's screen in pixels.
        
    *   screen\_widthinteger
        
        The width of the device's screen in pixels.
        
    *   timezonestring
        
        The time zone of the device.
        
    *   Custom Device Attributes \*string
        
        Custom properties that you want to associate with the device.
        
*   last\_usedinteger(unix timestamp)
    
    The `timestamp` when you last identified this device. If you don't pass a timestamp when you add or update a device, we use the time of the request itself. Our SDKs identify a device when a person launches their app.
    

#### Custom device attributes

When we collect device attributes, you can also set custom device attributes with the `deviceAttributes` method. You might do this to save app preferences, time zone, or other custom values specific to the device.

```
CustomerIO.shared.deviceAttributes = ["company" : "cio", "checklist" : "complete"]
```

However, before you set custom device attributes, consider whether the attribute is specific to the `device` or if it applies to the person broadly. Device tokens are ephemeral—they can change based on user behavior, like when a person uninstalls and reinstalls your app. If you want an attribute to persist beyond the life of the device, you should [apply it to the person](#identify-again) rather than the device.

#### Disable automatic device attribute collection

By default, the SDK automatically collects the device attributes [defined above](#device-attributes). You can change your config to prevent the SDK from automatically collecting these attributes.

```
import CioDataPipelines

let config = SDKConfigBuilder(cdpApiKey: "YOUR_CDP_API_KEY")
            .migrationSiteId("YOUR_SITE_ID")
            .autoTrackDeviceAttributes(false)

CustomerIO.initialize(withConfig: config.build()) 
```

## Stop identifying a person

When a person logs out, or does something else to tell you that they no longer want to be tracked, you should stop identifying them.

Use `clearIdentify()` to stop identifying the previously identified person (if there was one).

```
// Future calls to the Customer.io SDK are anonymous 
CustomerIO.shared.clearIdentify()
```

### Identify a different person

If you want to identify a new person—like when someone switches profiles on a streaming app, etc—you can simply call `identify()` for the new person. The new person then becomes the currently-identified person, with whom all new information—messages, events, etc—is associated.

---

## Tracking > Lifecycle events

**Source:** /integrations/sdk/ios/tracking/lifecycle-events

# Mobile lifecycle events

By default, the Customer.io SDK for iOS automatically tracks lifecycle events for your users. These are events that represent the lifecycle of your app and your users experiences with it.

By default, we track the following lifecycle events:

*   **Application Installed**: A user installed your app.
*   **Application Updated**: A user updated your app.
*   **Application Opened**: A user opened your app.
*   **Application Foregrounded**: A user switched back to your app.
*   **Application Backgrounded**: A user backgrounded your app or switched to another app.

You might also want to send your own lifecycle events, like `Application Crashed` or `Application Updated`. You can do this using the `track` call. You’ll find a list of properties for these events—both the ones we track automatically and other events you might send yourself—in our [Mobile App Lifecycle Event specification](/integrations/api/cdp/mobile-app/).

## Lifecycle event examples

A lifecycle event is basically a `track` call that the SDK makes automatically for you.

When you look at your data in Customer.io, you’ll see lifecycle events as `track` calls, where the event `properties` are specific to the name of the event. For example, the `Application Installed` event includes the app `version` and `build` properties.

```
{
  "userId": "app.installer@example.com",
  "type": "track",
  "event": "Application Installed",
  "properties": {
    "version": "3.2.1", "build": "247"
  }
}
```

## Sending custom lifecycle events

You can send your own lifecycle events using the `track` call. However, whenever you send lifecycle events, you should use the *Application EventName* convention that we use for our default lifecycle events.

These [semantic event](/integrations/data-in/semantic-events/) names and properties represent [a standard](/integrations/data-in/semantic-events/mobile-app/) that we use across Customer.io and our downstream destinations. Adhering to this standard ensures that your events automatically map to the correct event types in Customer.io and any other services you send your data to.

If you opt out of automatic lifecycle events, you can send your own `track` calls for these events. Or, for events we can’t track automatically, you might be able to use a webhook or a callback to collect crash events. For example, you might want to send a `track` call for `Application Crashed` when your app crashes or `Application Updated` when people update your app.

```
import CioDataPipelines

CustomerIO.shared.track(
    name: "Application Crashed", 
    properties: [
      "url": "urls://page/in/app"
    ]
)
```

## Disable lifecycle events

We track lifecycle events by default. You can disable this behavior by passing the `trackApplicationLifecycleEvents` option to the SDK’s config builder.

```
import CioDataPipelines

let config = SDKConfigBuilder(cdpApiKey: "CDP_API_KEY")
  .trackApplicationLifecycleEvents(false)
  .build()

CustomerIO.initialize(withConfig: config)
```

---

## Tracking > Location

**Source:** /integrations/sdk/ios/tracking/location

# Location tracking

## How it works

The Location module captures location (with user consent) from your app and attaches it to a person in Customer.io. You can use this data for geo-aware messaging and audience segmentation with more accuracy than [IP-based geolocation](/messaging/people/location/geolocation/).

When you identify a person, the SDK includes the latest location in the identify call. The SDK also sends a `Location Update` event to the person’s activity timeline, which you can use in journeys and segments. To balance location updates with battery and data usage, the SDK limits location updates once a day (at most)—and only sends that update when the person has moved more than 1 kilometer since the last update.

The SDK does not request location permission on its own—your app must handle the permission flow.

## Install the location module

Add the `CioLocation` package to your project. If you use Swift Package Manager, add it the same way you added the other Customer.io packages. The `CioLocation` library is part of the [`customerio-ios` ↗](https://github.com/customerio/customerio-ios) package.

If you use CocoaPods, add the pod to your Podfile:

```
pod 'CustomerIO/Location'
```

## Initialize the SDK with the location module

Register `LocationModule` when you initialize the SDK. The module takes a `LocationConfig` where you set the tracking mode.

Option

Type

Default

Description

`mode`

`LocationTrackingMode`

`.manual`

Controls how and when the SDK captures location. See [tracking modes](#tracking-modes) below.

### Tracking modes

Mode

Description

`.manual`

Your app controls when it captures location. Call `setLastKnownLocation(_:)` or `requestLocationUpdate()` to provide location. You should use this option when your app already has a location-tracking mechanism or you want full control over when you capture location data.

`.onAppStart`

The SDK automatically captures a one-shot location once per app launch when your app enters the foreground. You can still call `setLastKnownLocation(_:)` or `requestLocationUpdate()` alongside automatic capture. Use this for hands-off location tracking with minimal battery impact.

`.off`

Disables location tracking entirely. All location calls become silent and location is not included in identify calls. Use this if you want to register the module but disable it at runtime.

```
import CioDataPipelines
import CioLocation

let config = SDKConfigBuilder(cdpApiKey: "your-cdp-api-key")
    .addModule(LocationModule(config: LocationConfig(mode: .manual)))
    .build()

CustomerIO.initialize(withConfig: config)
```

## Location APIs

The module provides two methods to capture location. You can call either method as often as you like; the SDK always caches the latest coordinates to enrich the person’s attributes, but sends a `Location Update` event no more than once a day—and only if the person has moved more than 1 kilometer since the last update. No matter how frequently you call these methods, the SDK throttles the updates for you so as not to overwhelm your workspace with profile updates.

### `setLastKnownLocation`

Pass a `CLLocation` directly from your app’s own location system. This doesn’t require any location permissions from the SDK. Your app manages location access independently of Customer.io.

```
import CoreLocation
import CioLocation

// From a CLLocationManager delegate callback
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
    if let location = locations.last {
        CustomerIO.location.setLastKnownLocation(location)
    }
}
```

### `requestLocationUpdate`

Request a one-shot location from the SDK using Core Location. Use this if your app doesn’t have its own location system. Your app must request location permission before calling this method—the SDK won’t prompt the user.

If a user doesn’t grant permission or location services are disabled, the request is ignored—no crash or exception. If a request is already in progress, additional calls are ignored until the current request completes.

Add the required key to your `Info.plist`:

```
<key>NSLocationWhenInUseUsageDescription</key>
<string>We use your location to personalize your experience.</string>
```

Request permission at runtime, then call the SDK:

```
import CoreLocation
import CioLocation

let locationManager = CLLocationManager()

// Request permission first
locationManager.requestWhenInUseAuthorization()

// After permission is granted
CustomerIO.location.requestLocationUpdate()
```

## Switching people

When you call `CustomerIO.shared.clearIdentify()`, the SDK clears cached location data so that one person’s location doesn’t carry over to another person. The next person you identify starts with a clean slate.

Location persists across app restarts. When your app relaunches, the SDK restores the cached location so that the next `identify()` call includes it automatically.

---

## Tracking > Screen events

**Source:** /integrations/sdk/ios/tracking/screen-events

# Screen tracking

Screen views are events that record the pages that your audience visits in your app. They have a `type` property set to `screen`, and a `title` representing the title of the screen or page that a person visited in your app.

Screen view events let you trigger [automations](/journeys/send/campaigns/overview/) or add people to [segments](/journeys/segmentation/data-driven-segments/) based on the parts of your app your they use. Screen events also update your audience’s “Last Visited” attribute, which can help you track how recently people used your app.

## Automatic screen tracking

We can automatically track screens for UIKit-based apps with the `.autoTrackUIKitScreenViews` configuration option. When you enable automatic screen tracking, the SDK sends a `screen` call every time a person visits a screen in your app. **For apps not using UIKit, like SwiftUI apps, you should [manually track screen events](#manual-screenview).**

To enable automatic screen tracking, you can pass `.autoTrackUIKitScreenViews()` to the `SDKConfigBuilder` or you can [customize the behavior for automatic screen tracking](#customize-automatic-screen-tracking) if you want to filter the screens the SDK sends events for or add additional properties to the `screen` events.

When you’re done, we recommend you [test that automatic screen tracking works for your app](#test-automatic-screen-tracking). If you encounter issues, you can always send screen events manually.

```
import CioDataPipelines

let config = SDKConfigBuilder(cdpApiKey: "CDP_API_KEY")
  .autoTrackUIKitScreenViews()
  .build()
```

If you don’t use UIKit, or otherwise need to send your own screen events, you can [send screen events manually](#manual-screenview).

### Screenview settings for in-app messages

Customer.io uses `screen` events to determine where users are in your app so you can target them with in-app messages on specific screens. By default, the SDK sends `screen` events to Customer.io’s backend servers. But, if you don’t use `screen` events to track user activity, segment your audience, or to trigger automations, these events might constitute unnecessary traffic and event history.

If you don’t use `screen` events for anything other than in-app notifications, you can set the `ScreenViewUse` parameter to `screenView: inApp`. This setting stops the SDK from sending `screen` events back to Customer.io but still allows the SDK to use `screen` events for in-app messages, so you can target in-app messages to the right screen(s) without sending event traffic into Customer.io!

```
import CioDataPipelines

let config = SDKConfigBuilder(cdpApiKey: "CDP_API_KEY")
  .autoTrackUIKitScreenViews()
  .screenViewUse(screenView: .inApp)
  .build()
```

### Screen names

When you enable automatic screen views, the SDK automatically names the screen as the class name of the `UIViewController`, minus `ViewController`. For example, if you have a class `EditProfileViewController` in your code base, the SDK will automatically send a screenview event with the screen name `EditProfile`.

### Customize automatic screen tracking

You can also set additional parameters to customize the behavior of automatic screen tracking.

*   `autoScreenViewBody`: (optional) Closure that returns a dictionary of properties that you want to send with each automatic `screen` call.
*   `filterAutoScreenViewEvents`: (optional) Closure that returns a boolean—`true` to send an automatic `screen` call; `false` to prevent an automatic call.

```
import CioDataPipelines

let config = SDKConfigBuilder(cdpApiKey: "CDP_API_KEY")
  .autoTrackUIKitScreenViews(
    autoScreenViewBody: {
      return [:]
    },  // optional
    filterAutoScreenViewEvents: { (viewController: UIViewController) in
      return true
    }  // optional
  )
  .build()

CustomerIO.initialize(withConfig: config)
```

### Test automatic screen tracking for your app

The automatic screen tracking feature is designed to work with most UIKit-based apps, but it may not work with especially complex navigation structures. If you’ve got a significantly complex UIKit-based navigation structure, you may need to send screen events manually.

When you enable automatic screen tracking, you may want to enable info-level logging and walk through your app to make sure screen events come through as expected. If you encounter issues, you probably need to [send events manually for problematic screens](#manual-screenview).

```
import CioDataPipelines

let config = SDKConfigBuilder(cdpApiKey: "YOUR_CDP_API_KEY")
            .migrationSiteId("YOUR_SITE_ID")
            .autoTrackUIKitScreenViews(true)
            .logLevel("info")

CustomerIO.initialize(withConfig: config.build()) 
```

## Manually track screen events

Screen events use the `.screen` method. Like other event types, you can add a `properties` object containing additional information about the event or the currently-identified person.

```
import CioDataPipelines

// You can send an event with or without `properties`.
CustomerIO.shared.screen(title: "DailyBaseballScores")
// `properties` accepts [String: Any] or an `Encodable` object 
// 1. [String: Any]:
let data = ["prev_screen": "homescreen", "seconds_in_app": "120"]
CustomerIO.shared.screen(title: "DailyBaseballScores", properties: data)

// 2. A custom `Encodable` type:
struct Screen: Encodable {
  let prevScreen: String
  let secondsInApp: Int
}
CustomerIO.shared.screen(title: "DailyBaseballScores", properties: Screen(prevScreen: "homescreen", secondsInApp: 120))
```

---

## Tracking > Track events

**Source:** /integrations/sdk/ios/tracking/track-events

# Track events

Events represent things people do in your app so that you can track your audience's activity and metrics. Use events to segment your audience, trigger automations, and capture usage metrics in your app.

## Track an event

The `track` method helps you send events representing your audience’s activities to Customer.io. When you send events, you can include event `properties`—information about the person or the event that they performed.

In Customer.io, you can use events to trigger automations and broadcasts. Those automations might send someone a push notification or manipulate information associated with the person in your workspace.

Events include the following:

*   `name`: the name of the event. Most event-based searches in Customer.io hinge on the name, so make sure that you provide an event name that will make sense to other members of your team.
*   `properties` (Optional): Additional information that you might want to reference in a message. You can reference data attributes in messages and other workflow actions using [liquid](/journeys/liquid/using-liquid) in the format `{{event.<attribute>}}`.

```
import CioDataPipelines

CustomerIO.shared.track(name: "logged_in", properties: ["ip": "127.0.0.1"])

// You don't need to send `data`
CustomerIO.shared.track(name: "played_game")

// `data` accepts [String: Any] or an `Encodable` object 
// 1. [String: Any]:
let data = ["product": "socks", "price": "23.45"]
CustomerIO.shared.track(name: "purchase", properties: data)

// 2. A custom `Encodable` type:
struct Purchase: Encodable {
  let product: String
  let price: Double
}
CustomerIO.shared.track(name: "purchase", properties: Purchase(product: "socks", price: 23.45))
```

Perform downstream actions with semantic events

Some downstream actions don’t neatly map to our simple `identify`, `track`, and other calls. For these, we use “semantic events,” events that have a special meaning in Customer.io and your destinations. See [Semantic Events](#semantic-events) for more information.

### Anonymous activity

If you send a `track` call before you `identify` a person, we’ll attribute the event to an `anonymousId`. When you identify the person, we’ll reconcile their anonymous activity with the identified person.

When we apply anonymous events to an identified person, the previously anonymous activity becomes eligible to trigger automations in Customer.io.

## Semantic Events

Some actions don’t map cleanly to our simple `identify`, `track`, and other calls. For these, we use “semantic events,” events that have a special meaning in Customer.io and your destinations.

These are especially important in Customer.io for destructive operations like deleting a person. When you send an event with a semantic `event` name, we’ll perform the appropriate action.

For example, if a person decides to leave your service, you might delete them from your workspace. In Customer.io, you’ll do that with a `Delete Person` event.

For example, you can associate a person with a group (called an [object](/messaging/objects-data/objects/start/) in Customer.io) with a simple `group` call. But what if you wanted to remove someone from the group? In Customer.io, you do that with an event called `Relationship Deleted`.

```
CustomerIO.shared.track(name: "User Deleted)
```

---

## Whats new > 2.x upgrade

**Source:** /integrations/sdk/ios/whats-new/2.x-upgrade

# Upgrade from 1x to 2x

This page details breaking changes from previous versions, so you understand the development effort required to update your app and take advantage of the latest features.

## Versioning

We try to limit breaking or significant changes to major version increments. The three digits in our versioning scheme represent major, minor, and patch increments respectively.

 ![sdk versioning scheme](https://customer.io/images/sdk-versions.jpg)

*   **Major**: may include breaking changes, and generally introduces significant feature updates.
*   **Minor**: may include new features and fixes, but won’t include breaking changes. You may still need to do some development to use new features in your app.
*   **Patch**: Increments represent minor fixes that should not require development effort.

## Upgrade from 1.x to 2.x

### Singleton API is now enforced

In version 1.x of the Customer.io iOS SDK, could use the SDK in 2 ways:

1.  Singleton API:

```
CustomerIO.initialize(...) // initialize the singleton SDK instance
Customer.shared.track(...) // use the singleton SDK instance 
```

2.  Non-singleton API:

```
let cio = CustomerIO(...) // initialize the non-singleton SDK instance
cio.track(...)            // use the non-singleton SDK instance 
```

In version 2.x, we removed the non-singleton API. To successfully migrate, you need to replace any code using a non-singleton with the singleton instance:

```
// Replace the non-singleton instance:
cio.track(...) 
messagingPush.application(...)
// With `CustomerIO.shared` or `MessagingPush.shared`:
CustomerIO.shared.track(...) 
MessagingPush.shared.application(...)
```

If your app uses a technique like dependency injection, you can keep your code base as-is and simply replace code where you create new instances of the SDK:

```
// For example, if you have code that accepts a CustomerIO dependency in the constructor (to easily allow mocking the Customer.io SDK):
class Repository {
    let customerIO: CustomerIO

    init(customerIO: CustomerIO) {
        self.customerIO = customerIO
    }
    
    func acceptFriendRequest() {
        ...
        self.customerIO.track(...)
        ...
    }
}

// You can keep your Repository as-is, but you need to change where you create instances from:
let repository = Repository(customerIO: CustomerIO(...))
repository.acceptFriendRequest()
// To:
let repository = Repository(customerIO: CustomerIO.shared) // Don't forget to initialize the SDK 😉
repository.acceptFriendRequest()
```

### Configuration of the SDK happens during initialization

In version 1.x of the Customer.io iOS SDK, you configured the SDK through a `.config` function:

```
CustomerIO.config {
  $0.autoTrackScreenViews = true
}
```

In version 2.x of the Customer.io iOS SDK, we moved the `.config` function into `CustomerIO.initialize`. You’ll need to move your configuration into the SDK initialization process to migrate:

```
CustomerIO.initialize(siteId: "YOUR SITE ID", apiKey: "YOUR API KEY", region: Region.EU) { config in
  config.autoTrackScreenViews = true
}
```

Visit [the getting started doc](/integrations/sdk/ios/getting-started/) to learn more about SDK configuration.

### SDK initialization: required parameters

In version 1.x of the Customer.io SDK, the function `CustomerIO.initialize` contained optional parameters. We had to remove those and make all parameters required.

To migrate to 2.x of the SDK, fill in the rest of the parameters in your `initialize` function:

```
// v1.x
CustomerIO.initialize(siteId: "YOUR SITE ID", apiKey: "YOUR API KEY")

// v2.x
CustomerIO.initialize(siteId: "YOUR SITE ID", apiKey: "YOUR API KEY", region: Region.US) {}
// Optionally, if you want to configure settings of the SDK, do so in initialization. 
CustomerIO.initialize(siteId: "YOUR SITE ID", apiKey: "YOUR API KEY", region: Region.EU) { config in
  config.autoTrackScreenViews = true
}
```

Visit [the getting started doc](/integrations/sdk/ios/getting-started/) to learn more about SDK configuration.

### Rich push initialization

If you have [followed our docs to setup rich push](/integrations/sdk/ios/rich-push/) in your app, you should have a `Notification Service Extension` file in your code base.

Because of the behavior of Notification Service Extensions in iOS, you need to initialize the Customer.io SDK in your host app *and in your Notification Service*.

```
class NotificationService: UNNotificationServiceExtension {
   
    override func didReceive(
        _ request: UNNotificationRequest,
        withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void
    ) {
        // Make sure to initialize the SDK at the top of this function. 
        CustomerIO.initialize(siteId: "YOUR SITE ID", apiKey: "YOUR API KEY", region: Region.US) { config in
            config.autoTrackPushEvents = true 
        }
        ...
    }
}
```

See [our docs for rich push](/integrations/sdk/ios/rich-push/) to learn more about rich push setup, SDK initialization, and SDK configuration.

### Cocoapods users must manually install Firebase dependencies

We removed all Firebase SDKs as dependencies from the `CustomerIO/MessagingPushFCM` Cocoapod. This means that you need to install the Firebase Cloud Messaging (FCM) dependencies in your `Podfile` on your own.

If you installed the Customer.io SDK using Swift Package Manager, this change does not effect you.

### We fixed a bug with custom attributes that may impact your data

SDK functions that let you send custom data—`trackEvent`, `screen`, `identify` and `deviceAttribute` calls—may have been impacted by a bug in v1 that converted keys in your custom data to `snake_case`. This bug is fixed in v2 of the iOS SDK. You will see your data in Customer.io exactly as you pass it to the SDK.

*This bug didn’t surface with all data; it did not affect you if you already snake-cased your data; and it did not affect our Android SDK.*.

```
// If you passed in custom attributes using camelCase keys: 
data = ["firstName": "Dana"]
// The SDK v1 may have converted this data into: 
data = ["first_name": "Dana"]

// Or, if you used a different format that was not snake_case: 
data = ["FIRSTNAME": "Dana"]
// The SDK v1 may have converted this data into: 
data = ["f_irstname": "Dana"]
```

You don’t *need* to do anything before you update. But we strongly recommend that you go to **Data Index** and audit your *attributes* and *events* to determine if the v1 SDK reshaped your data. Make sure that updating to the 2.x SDK won’t impact your segments, automations, etc by sending data in a different (but expected) format to Customer.io.

 ![use the data index to audit events and attributes](https://customer.io/images/data-index-mistake.png)

**If your data was affected, you can either:**

1.  [(Recommended) Update your attributes, segments, and other information stored in Customer.io to use your original data format.](#v2-option-1)
2.  [Set your app to continue using the snake-cased data passed by the 1.x SDK.](#v2-option-2)

#### Option 1 (Recommended): Update your data in Customer.io

##### For Events: `trackEvent` and `screen` calls

Unfortunately, you can’t modify past events sent by `trackEvent` or `screen` calls. But, before you move forward with the 2.0 SDK, you can update your segments, automations, and other Customer.io assets to use your original, not-reshaped data format.

For [segments](/journeys/segmentation/data-driven-segments/) , you should use **OR** conditions with the bugged, snake-cased format and your preferred data format. This ensures that people enter your segments and automations whether they use your app with the 1.x or 2.x SDKs.

 ![set up OR conditions in segments](https://customer.io/images/ios-segment-migration.png)

##### For Attributes: `identify`, `profileAttributes`, and `deviceAttribute` calls

If your customer data was inappropriately snake-cased by the v1 SDK, you can set up an automation to apply correctly formatted attributes in Customer.io so you don’t need to update your app! If you update your data this way, you may still need to update segments and other assets to use the correct data shape.

1.  Create a segment of people possessing the affected, snake-cased attributes.
    
2.  Create an automation using this segment as a trigger.
    
3.  In the workflow, add two *Create or Update Person* actions.
    
     ![set up an automation to update attributes](https://customer.io/images/ios-snake-case-campaign.png)
    
4.  Configure the first action to set correctly formatted attributes using the values from your previously-misshaped attributes. Use liquid to identify the attributes in question. Use a liquid or JS *if* statement to set an attribute value if it exists, otherwise your automation may experience errors.
    
    ```
    {% if customer.snake_case %}{{customer.snake_case}}{% endif %}
    ```
    
     ![set up an action to update attributes](https://customer.io/images/ios-snake-case-update.png)
    
5.  Configure the second *Create or Update Person* action to remove the bugged, snake-case attributes from your audience.
    
     ![set up an action to remove misshaped attributes](https://customer.io/images/ios-snake-case-delete.png)
    
6.  Make sure that your [segments](/journeys/segmentation/data-driven-segments/) , filters, and other items that might be based on people’s attributes or device attributes are all set to use your preferred format.
    

#### Option 2: Use snake-cased formats in your app

```
// Anywhere you call the Customer.io SDK and provide custom attributes like this: 
CustomerIO.shared.identify("dana@example.com", data: ["firstName": "Dana"])

// Consider sending duplicate data with snake_case
CustomerIO.shared.identify("dana@example.com", data: [
    "firstName": "Dana", // Attribute used with v1 of the SDK that got converted to snake_case. Keeping it here as the bug has been fixed. 
    "first_name": "Dana" // Adding this duplicate attribute for backwards compatibility with customers using old versions of your app. 
])
```

Then, after you have determined that all of your app’s customers have updated their app to a version of your app no longer using v1 of the Customer.io SDK, you can remove this duplication:

```
CustomerIO.shared.identify("dana@example.com", data: [
    "firstName": "Dana", // We can remove the snake_case attribute and go back to just camelCase! 
])
```

---

## Whats new > 3.13.0 upgrade

**Source:** /integrations/sdk/ios/whats-new/3.13.0-upgrade

# Upgrade from 3.x to 3.13.0

This page introduces a new `CioAppDelegateWrapper` pattern for iOS that simplifies push notification setup and eliminates the need for method swizzling.

## What changed?

The changes are mainly to align our SDK APIs across different platforms. No functional changes to be expected.

## Upgrade process

### Attributes

*   `profileAttributes` property is deprecated
    *   Getter has no replacement, the mobile SDK doesn’t expose the user’s profile attributes
    *   Setter is replaced with `setProfileAttributes(attributes: [String: Any])`
*   `deviceAttributes` property is deprecated
    *   Getter has no replacement, the mobile SDK doesn’t expose the user’s device attributes
    *   Setter is replaced with `setDeviceAttributes(attributes: [String: Any])`

### Tracking

*   Identifying a user
    
    *   These variants of `identify` are deprecated:
        *   `identify<T: Codable>(traits: T)` where traits are a generic type
        *   `identify<RequestBody: Codable>(userId: String, traits: RequestBody?)`
    *   You should use this instead:
        *   `identify(userId: String, traits: [String: Any]?)`
        *   `setProfileAttributes(attributes: [String: Any])` can now be used to track anonymous profile attributes
*   Tracking an event
    
    *   These variants of `track` are deprecated:
        *   `track<RequestBody: Codable>(name: String, properties: RequestBody?)` where traits are a generic type
    *   You should use this instead:
        *   `track(name: String, properties: [String: Any]?)`
*   Screen tracking
    
    *   These variants of `screen` are deprecated:
        *   `screen<RequestBody: Codable>(title: String, properties: RequestBody?)` where traits are a generic type
    *   You should use this instead:
        *   `screen(title: String, properties: [String: Any]?`

---

## Whats new > 3.9.0 upgrade

**Source:** /integrations/sdk/ios/whats-new/3.9.0-upgrade

# Upgrade from 3.x to 3.9.0

This page introduces a new `CioAppDelegateWrapper` pattern for iOS that simplifies push notification setup and eliminates the need for method swizzling.

## Key Changes

The primary change in version 3.9.0 is the introduction of the wrapper pattern for handling push notifications on iOS. This change:

*   **Eliminates method swizzling**: No more automatic method replacement
*   **Simplifies setup**: Less boilerplate code required
*   **Improves reliability**: More predictable behavior

See the instructions below to update your app depending on whether you send push notifications with APN or FCM and whether you use UIKit or SwiftUI.

## Update with APNs

### UIKit

Update your `AppDelegate.swift` file to use the new `CioAppDelegateWrapper` pattern. See the *Before* sample to see what needs to change and the *After* sample to see the new pattern.

Before (3.x)After (3.9.0)

#### Before (3.x)

```
import UIKit
import CioMessagingPushAPN

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.

        // Initialize the Customer.io SDK 
        let cdpApiKey = "YOUR_CDP_API_KEY"
        let siteId = "YOUR_SITE_ID"
        let config = SDKConfigBuilder(cdpApiKey: cdpApiKey)
            // If your account is in the EU region, uncomment the next line
            // .region(.EU)
            .migrationSiteId(siteId) // only required if you used version 2.x or earlier
            .autoTrackUIKitScreenViews() // Set auto tracking of UIKit screen views
            .logLevel(CioLogLevel.debug) // Add this to troubleshoot issues - disable debug in production
        CustomerIO.initialize(withConfig: config.build())

        return true
    }
}
```

#### After (3.9.0)

```
import UIKit
import CioMessagingPushAPN

@main
class AppDelegateWithCioIntegration: CioAppDelegateWrapper<AppDelegate> {}

class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.

        // Initialize the Customer.io SDK 
        let cdpApiKey = "YOUR_CDP_API_KEY"
        let siteId = "YOUR_SITE_ID"
        let config = SDKConfigBuilder(cdpApiKey: cdpApiKey)
            // If your account is in the EU region, uncomment the next line
            // .region(.EU)
            .migrationSiteId(siteId) // only required if you used version 2.x or earlier
            .autoTrackUIKitScreenViews() // Set auto tracking of UIKit screen views
            .logLevel(CioLogLevel.debug) // Add this to troubleshoot issues - disable debug in production
        CustomerIO.initialize(withConfig: config.build())

        return true
    }
}
```

### SwiftUI

If you’re using SwiftUI, you’ll need to use the `@UIApplicationDelegateAdaptor` instead of the `@main` attribute. See the *Before* sample to see what needs to change and the *After* sample to see the new pattern.

Before (3.x)After (3.9.0)

#### Before (3.x)

```
import SwiftUI
import CioMessagingPushAPN

@main
struct MyApp: App {
    @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
    
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Initialize the Customer.io SDK 
        let cdpApiKey = "YOUR_CDP_API_KEY"
        let siteId = "YOUR_SITE_ID"
        let config = SDKConfigBuilder(cdpApiKey: cdpApiKey)
            // If your account is in the EU region, uncomment the next line
            // .region(.EU)
            .migrationSiteId(siteId) // only required for migration
            .autoTrackUIKitScreenViews() // Set auto tracking of UIKit screen views
            .logLevel(CioLogLevel.debug) // Add this to troubleshoot issues - disable debug in production
        CustomerIO.initialize(withConfig: config.build())

        return true
    }
}
```

#### After (3.9.0)

```
import SwiftUI
import CioMessagingPushAPN

@main
struct MyApp: App {
    @UIApplicationDelegateAdaptor(CioAppDelegateWrapper<AppDelegate>.self) var appDelegate
    
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Initialize the Customer.io SDK 
        let cdpApiKey = "YOUR_CDP_API_KEY"
        let siteId = "YOUR_SITE_ID"
        let config = SDKConfigBuilder(cdpApiKey: cdpApiKey)
            // If your account is in the EU region, uncomment the next line
            // .region(.EU)
            .migrationSiteId(siteId) // only required for migration
            .autoTrackUIKitScreenViews() // Set auto tracking of UIKit screen views
            .logLevel(CioLogLevel.debug) // Add this to troubleshoot issues - disable debug in production
        CustomerIO.initialize(withConfig: config.build())

        return true
    }
}
```

## Update with FCM

### UIKit

Update your `AppDelegate.swift` file to use the new `CioAppDelegateWrapper` pattern. See the *Before* sample to see what needs to change and the *After* sample to see the new pattern.

Before (3.x)After (3.9.0)

#### Before (3.x)

```
import UIKit
import CioMessagingPushFCM
import Firebase
import FirebaseMessaging

@main
class AppDelegate: NSObject, UIApplicationDelegate {
 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
     // Initialize the Firebase SDK.
     FirebaseApp.configure()

     let siteId = YOUR_SITE_ID
     let cdpApiKey = YOUR_CDP_API_KEY

     // Configure and initialize the Customer.io SDK
     let config = SDKConfigBuilder(cdpApiKey: cdpApiKey)
         .migrationSiteId(siteId)
         .autoTrackUIKitScreenViews()
         .autoTrackDeviceAttributes(true)
  
     CustomerIO.initialize(withConfig: config.build())

     // Initialize messaging features after initializing Customer.io SDK        
     MessagingPushFCM.initialize(
         withConfig: MessagingPushConfigBuilder()
             // optionally, configure the push module by calling functions on the builder. Such as: 
             .autoFetchDeviceToken(true)
             // See section below to find all the configuration options you can set. 
             .build()
     )

     return true
 }
}
```

#### After (3.9.0)

```
import UIKit
import CioMessagingPushFCM
import Firebase
import FirebaseMessaging

@main
class AppDelegateWithCioIntegration: CioAppDelegateWrapper<AppDelegate> {}

class AppDelegate: NSObject, UIApplicationDelegate {
 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
     // Initialize the Firebase SDK.
     FirebaseApp.configure()

     let siteId = YOUR_SITE_ID
     let cdpApiKey = YOUR_CDP_API_KEY

     // Configure and initialize the Customer.io SDK
     let config = SDKConfigBuilder(cdpApiKey: cdpApiKey)
         .migrationSiteId(siteId)
         .autoTrackUIKitScreenViews()
         .autoTrackDeviceAttributes(true)
  
     CustomerIO.initialize(withConfig: config.build())

     // Initialize messaging features after initializing Customer.io SDK        
     MessagingPushFCM.initialize(
         withConfig: MessagingPushConfigBuilder()
             // optionally, configure the push module by calling functions on the builder. Such as: 
             .autoFetchDeviceToken(true)
             // See section below to find all the configuration options you can set. 
             .build()
     )

     return true
 }
}
```

### SwiftUI

If you’re using SwiftUI, you’ll need to use the `@UIApplicationDelegateAdaptor` instead of the `@main` attribute. See the *Before* sample to see what needs to change and the *After* sample to see the new pattern.

Before (3.x)After (3.9.0)

#### Before (3.x)

```
import SwiftUI
import CioMessagingPushFCM
import UserNotifications

@main
struct MyApp: App {
    @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
    
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Initialize the Customer.io SDK 
        let cdpApiKey = "YOUR_CDP_API_KEY"
        let siteId = "YOUR_SITE_ID"
        let config = SDKConfigBuilder(cdpApiKey: cdpApiKey)
            // If your account is in the EU region, uncomment the next line
            // .region(.EU)
            .migrationSiteId(siteId) // only required for migration
            .autoTrackUIKitScreenViews() // Set auto tracking of UIKit screen views
            .logLevel(CioLogLevel.debug) // Add this to troubleshoot issues - disable debug in production
        CustomerIO.initialize(withConfig: config.build())

        return true
    }
}
```

#### After (3.9.0)

```
import SwiftUI
import CioMessagingPushFCM
import UserNotifications

@main
struct MyApp: App {
    @UIApplicationDelegateAdaptor(CioAppDelegateWrapper<AppDelegate>.self) var appDelegate
    
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Initialize the Customer.io SDK 
        let cdpApiKey = "YOUR_CDP_API_KEY"
        let siteId = "YOUR_SITE_ID"
        let config = SDKConfigBuilder(cdpApiKey: cdpApiKey)
            // If your account is in the EU region, uncomment the next line
            // .region(.EU)
            .migrationSiteId(siteId) // only required for migration
            .autoTrackUIKitScreenViews() // Set auto tracking of UIKit screen views
            .logLevel(CioLogLevel.debug) // Add this to troubleshoot issues - disable debug in production
        CustomerIO.initialize(withConfig: config.build())

        return true
    }
}
```

## Important Notes

1.  `CioAppDelegateWrapper` automatically records information from following methods. But you can still use these methods if you want to add custom push handling:
    
    *   `didRegisterForRemoteNotificationsWithDeviceToken`
    *   `didFailToRegisterForRemoteNotificationsWithError`
    *   `didReceiveRemoteNotification`
    *   `userNotificationCenter(_:willPresent:withCompletionHandler:)`
    *   `userNotificationCenter(_:didReceive:withCompletionHandler:)`
    *   All other push-related delegate methods
2.  **The `@main` attribute** must be on the wrapper class, not your AppDelegate.
    

## Troubleshooting

If push notifications stop working after you update your implementation:

1.  Make sure that you’ve added the `@main` attribute to the wrapper class
2.  Verify that you’ve removed `@main` from your original AppDelegate
3.  Check that you’re calling `MessagingPushAPN.initialize()` or `MessagingPushFCM.initialize()`

---

## Whats new > 3.x upgrade

**Source:** /integrations/sdk/ios/whats-new/3.x-upgrade

# Upgrade from 2x to 3x

This page details breaking changes from the previous major version of the SDK, so you understand the development effort required to update your app and take advantage of the latest features.

## What changed?

This update provides native support for our new integrations framework. While this represents a significant change “under the hood,” we’ve tried to make it as seamless as possible for you; much of your implementation remains the same.

This move also adds two additional features:

*   **Support for anonymous tracking**: you can send events and other activity for anonymous users, and we’ll reconcile that activity with a person when you identify them.
*   **Built-in lifecycle events**: the SDK now automatically captures events like “Application Installed” and “Application Updated” for you.
*   **New device-level data**: the SDK captures the device `name` and other device-level context for you.

*   **A new `group` API call**: this new call helps you relate people to [objects](/messaging/objects-data/objects/start/) in Customer.io and accounts in other, downstream destinations.

## Upgrade process

You’ll update initialization calls for the SDK, the in-app messaging module, and the push module. The in-app and push modules are now required.

**As a part of this process, your credentials change**. You’ll need to set up a new data in integration in Customer.io and get a new *CDP API Key*. But you’ll *also* need to keep your previous `siteId` as a `migrationSiteId` when you initialize the SDK. The `migrationSiteId` is a key helps the SDK send remaining traffic when people update your app.

When you’re done, you’ll also need to change a few base properties to fit the new APIs. In general, `identifier` becomes `userId`, `body` becomes `traits`, and `data` becomes `properties`.

### 1\. Get your new *CDP API Key*

The new version of the SDK requires you to set up a new data in integration in Customer.io. As a part of this process, you’ll get your *CDP API Key*.

1.  Go to [*Integrations*](https://fly.customer.io/workspaces/last/journeys/integrations/all/overview) and click **Add integration**.
2.  Select **iOS**.
    
     ![set up your iOS source](https://customer.io/images/cdp-ios-source.png)
    
3.  Enter a *Name* for your integration, like “My iOS App”.
4.  Click the **Copy and paste code** tab. The code sample includes your public key (beginning with `pk_`) as `cdpApiKey`. Copy this key and keep it handy; you’ll need it to initialize the SDK.
    
     ![The integration setup screen, with a name for your integration and a code sample that includes your public key](https://customer.io/images/cdp-ios-source-setup.png)
    
5.  Click **Test connection** to check that Customer.io receives data from your app, and then click **Complete setup**. If you aren’t ready to test your app yet, click **Save for later**.

Remember, you can also [connect your iOS app to services outside of Customer.io](/integrations/data-out/add-destination/)—like your analytics provider, data warehouse, or CRM.

### 2\. Import CioDataPipelines instead of CioTracking

We’ve replaced the `CioTracking` package with `CioDataPipelines`. You’ll need to update your import statements to reflect this change.

If you see errors like *Missing required module ‘CioTracking’*, you can remove the package in XCode under *Frameworks and Libraries*.

```
// replace import CioTracking with:
import CioDataPipelines
```

### 3\. Update your `initialize` calls

You’ll initialize the new version of the SDK and its packages with `SDKConfigBuilder` objects instead of a `CustomerIOConfig`. A few of the configuration options changed. In particular,

*   `cdpApiKey` replaces `apiKey`: this is a new key that you got from [Step 1](#1-get-your-new-cdp-api-key)
*   `migrationSiteId` replaces `siteId`: this is the same key you used in the previous version of the SDK. **You need to include this property** to send remaining traffic when people update your app.
*   `autoTrackUIKitScreenViews` replaces `autoTrackScreenViews`: functionality is unchanged; we simply renamed the option to reflect support for UIKit and *not* SwiftUI.
*   **If you’re in our EU region**, make sure that you uncomment the `.region(.EU)` line in the sample below. Your config must include this property to send data to our EU data center.

APNSFCM

#### APNS

```
import CioDataPipelines
import CioMessagingInApp
import CioMessagingPushAPN
import UIKit

@main
// Add the CioAppDelegateWrapper to handle push notifications and device token registration
class AppDelegateWithCioIntegration: CioAppDelegateWrapper<AppDelegate> {}

class AppDelegate: UIResponder, UIApplicationDelegate {

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.

        let cdpApiKey = YOUR_CDP_API_KEY
        let siteId = YOUR_SITE_ID
        
        let config = SDKConfigBuilder(cdpApiKey: cdpApiKey)
            // uncomment the line below if your account is in the EU region
            // .region(.EU)
            .autoTrackDeviceAttributes(true)
            .migrationSiteId(siteId)
            //replaces autoTrackScreenViews
            .autoTrackUIKitScreenViews()

        CustomerIO.initialize(withConfig: config.build())

        // Initialize messaging features after initializing Customer.io SDK
        MessagingInApp
            .initialize(withConfig: MessagingInAppConfigBuilder(siteId: siteId, region: .US).build())
            .setEventListener(self)
        MessagingPushAPN.initialize(
            withConfig: MessagingPushConfigBuilder()
                .autoFetchDeviceToken(true)    // Automatically fetch device token and upload to CustomerIO
                .autoTrackPushEvents(true)     // Automatically track push metrics
                .showPushAppInForeground(true) // Enable Notifications in the foreground
                .build()
        )
      
        UNUserNotificationCenter.current().delegate = self

        return true
    }   
```

#### FCM

```
import CioDataPipelines
import CioMessagingInApp
import CioMessagingPushFCM
import FirebaseCore
import FirebaseMessaging
import Foundation
import UIKit

@main
// Add the CioAppDelegateWrapper to handle push notifications and device token registration
class AppDelegateWithCioIntegration: CioAppDelegateWrapper<AppDelegate> {}

class AppDelegate: NSObject, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
        // To set up FCM push: https://firebase.google.com/docs/cloud-messaging/ios/client
        // FCM provides a device token to the app that
        // you send to the Customer.io SDK.

        // Initialize the Firebase SDK.
        FirebaseApp.configure()

        let siteId = YOUR_JOURNEYS_SITE_ID
        let cdpApiKey = YOUR_CDP_API_KEY

        // Configure and initialize the Customer.io SDK
        let config = SDKConfigBuilder(cdpApiKey: cdpApiKey)
            // uncomment this line below if your account is in the EU region
            // .region(.EU)
            .migrationSiteId(siteId)
            .autoTrackDeviceAttributes(true)
            //replaces autoTrackScreenViews
            .autoTrackUIKitScreenViews()

  
        CustomerIO.initialize(withConfig: config.build())

        // Initialize messaging features after initializing Customer.io SDK
        MessagingInApp
            .initialize(withConfig: MessagingInAppConfigBuilder(siteId: siteId, region: .US).build())
            .setEventListener(self)
        MessagingPushFCM.initialize(
            withConfig: MessagingPushConfigBuilder()
                .autoFetchDeviceToken(true)    // Automatically fetch device token and upload to CustomerIO
                .autoTrackPushEvents(true)     // Automatically track push metrics
                .showPushAppInForeground(true) // Enable Notifications in the foreground
                .build()
        )

        // Manually get FCM device token. Then, we will forward to the Customer.io SDK.
        Messaging.messaging().delegate = self

        UNUserNotificationCenter.current().delegate = self

        return true
    }

    func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
        Messaging.messaging().apnsToken = deviceToken
    }
}
```

### 4\. Update your `NotificationServiceExtension`

You need to initialize the push module with your integration’s *CDP API Key*. Update your `NotificationServiceExtension` (using the appropriate push package, APN or FCM).

If you previously initialized the SDK using `CustomerIO.initialize`, you can remove that now. You *only* need to initialize the push package.

```
// use MessagingPushFCM if FCM is your push service
MessagingPushAPN.initializeForExtension(
  withConfig: MessagingPushConfigBuilder(
      cdpApiKey: "YOUR_CDP_API_KEY"
  )
  // Optional: set your Customer.io account region (.US or .EU). Default: US
  .region(.US)
  .build()
)
```

### 5\. Update your `identify`, `track`, and `screen` calls

Our APIs changed slightly in this release. We’ve done our best to make the new APIs as similar as possible to the old ones. The names of a few properties that you’ll pass in your calls have changed, but their functionality has not.

*   `identify`: `identifier` becomes `userId` and `body` becomes `traits`
*   `track`: `data` becomes `properties`
*   `screen`: `name` becomes `title`, and `data` becomes `properties`

New (3.x)Old (2.x)

#### New (3.x)

```
// CioDataPipelines replaces CioTracking 
import CioDataPipelines
//identify: identifier becomes userId, body becomes traits
CustomerIO.shared.identify(userId: "USER_ID", traits: ["age": 30])

// track: data becomes properties
CustomerIO.shared.track(name: "Purchase", properties: ["product": "shirt"])

// screen: name becomes title, data becomes properties
CustomerIO.shared.track(title: "Cart", properties: ["source": "link"])
```

#### Old (2.x)

```
import CioTracking

// identify
CustomerIO.shared.identify(identifier: "USER_ID", body: ["age": 30]) {}

// track
CustomerIO.shared.track(name: "Purchase", data: ["product": "shirt"])

// screen
CustomerIO.shared.track(name: "Cart", data: ["source": "link"])
```

## Configuration Changes

As a part of this release, we’ve changed a few configuration options. The `MessagingInApp` and `MessagingPush` modules also now take their own configuration options.

### `DataPipelines` configuration options

For the base SDK, you’ll use `SDKConfigBuilder` to set your configuration options. The following table shows the changes to the configuration options.

Field

Type

Default

Description

`cdpApiKey`

string

Replaces `apiKey`; required to initialize the SDK and send data into Customer.io.

`migrationSiteId`

string

Replaces `siteId`; required if you’re updating from 2.x. This is the key representing your previous version of the SDK.

`autoTrackUIKitScreenViews`

boolean

`false`

Replaces `autoTrackScreenViews`; functionality is unchanged. We simply renamed the option to reflect support for UIKit and *not* SwiftUI.

`trackApplicationLifeCycleEvents`

boolean

`true`

When true, the SDK automatically tracks application lifecycle events (like *Application Installed*).

### `MessagingPush` configuration options

You need to initialize the push package in both your `AppDelegate` and `NotificationServiceExtension` files. In your `AppDelegate`, you don’t need to pass options. You can simply pass `MessagingPushAPN.initialize()`.

But, in your `NotificationServiceExtension`, you’ll need to pass the `cdpApiKey` to initialize the push package.

```
MessagingPushAPN.initializeForExtension(withConfig: MessagingPushConfigBuilder(cdpApiKey: "CDP_API_KEY").build())
```

Option

Type

Default

Description

`region`

`.US` or `.EU`

`.US`

The region your Customer.io account resides in US or EU.

`autoFetchDeviceToken`

boolean

`true`

When `true`, the package automatically fetches the device token for push notifications.

`autoTrackPushEvents`

boolean

`true`

Automatically track `opened` and `delivered` metrics based on push notifications.

`showPushAppInForeground`

boolean

`true`

Show push notifications when the app is in the foreground. Used only if customer’s AppDelegate doesn’t implement `UNUserNotificationCenterDelegate`.

### `MessagingInApp` configuration options

When you initialize the `CioMessagingInApp` package, **you must pass both of these configuration options**.

Option

Type

Default

Description

`siteId`

string

The [Site ID](https://fly.customer.io/env/last/settings/api_credentials) from a set of Track API credentials; this determines the workspace that your app listens for in-app messages from.

`Region`

`.US` or `.EU`

`.US`

The region your Customer.io account resides in—US or EU.

---

## Whats new > 4.0.0 upgrade

**Source:** /integrations/sdk/ios/whats-new/4.0.0-upgrade

# Upgrade from 3.x to 4.0.0

This page details breaking changes from version 3.x to 4.0.0 of the SDK, specifically for users utilizing Firebase Cloud Messaging (FCM) for push notifications.

Upgrading straight to 5.x?

In version 5.0.0 and later, `CioFirebaseWrapper` comes from the `customerio-ios` package, not `customerio-ios-fcm`. If you’re upgrading from 3.x to 5.x, follow the dependency steps in [Upgrade from 4.x to 5.0.0](/integrations/sdk/ios/whats-new/5.0.0-upgrade/) instead of step 1 on this page.

## What changed?

Version 4.0.0 introduces a breaking change for users who utilize Firebase Cloud Messaging (FCM) for push notifications. The change improves the FCM integration by consolidating Firebase dependencies into a dedicated wrapper package.

### FCM Integration Changes

*   **New dependency required**: `CioFirebaseWrapper` package is now required for FCM push notifications
*   **Import statement updated**: Add `import CioFirebaseWrapper` wherever you use `import CioMessagingPushFCM`
*   **Initialize method unchanged**: Continue using `MessagingPushFCM.initialize()` but it now comes from the new package

**Note**: This change only affects users utilizing FCM for push notifications. If you use Apple Push Notification Service (APNs), no changes are required.

## Upgrade process

### 1\. Update dependencies

Update your dependency management configuration to include the new `CioFirebaseWrapper` package.

Swift Package Manager (SPM)CocoaPods

#### Swift Package Manager (SPM)

Add the `CioFirebaseWrapper` package to your project in Xcode:

1.  In Xcode, go to **File** > **Add Package Dependencies**
2.  Add `https://github.com/customerio/customerio-ios-fcm.git` if not already added
3.  Select the `CioFirebaseWrapper` package in addition to your existing packages

#### CocoaPods

Add the new pod to your `Podfile`:

```
# Add this new dependency for FCM push notifications.
# It's a standalone pod, not part of the CustomerIO pod.
pod 'CioFirebaseWrapper'

# Keep your existing dependencies
pod 'CustomerIO/DataPipelines'
pod 'CustomerIO/MessagingPushFCM'
pod 'CustomerIO/MessagingInApp'
```

Then run:

```
pod install
```

### 2\. Update import statements

Add `CioFirebaseWrapper` import statement in all files where you import `CioMessagingPushFCM`. Don’t change your other import statements:

```
import CioDataPipelines
import CioFirebaseWrapper
import CioMessagingPushFCM
import FirebaseCore
import FirebaseMessaging
import Foundation
import UIKit
```

### 3\. Verify initialization code

Your initialization code should remain the same. The `MessagingPushFCM.initialize()` method continues to work exactly as before, but now it comes from the `CioFirebaseWrapper` package:

```
// This initialization code remains unchanged
MessagingPushFCM.initialize(
    withConfig: MessagingPushConfigBuilder()
        .autoFetchDeviceToken(true)
        .build()
)
```

## Complete example

Here’s a complete example of the updated FCM setup:

```
import CioDataPipelines
import CioFirebaseWrapper
import CioMessagingPushFCM
import FirebaseCore
import FirebaseMessaging
import Foundation
import UIKit

@main
class AppDelegateWithCioIntegration: CioAppDelegateWrapper<AppDelegate> {}

class AppDelegate: NSObject, UIApplicationDelegate {
    func application(
        _ application: UIApplication, 
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
    ) -> Bool {
        // Initialize Firebase
        FirebaseApp.configure()
        
        let cdpApiKey = "YOUR_CDP_API_KEY"
        let siteId = "YOUR_SITE_ID"
        
        // Configure and initialize the Customer.io SDK
        let config = SDKConfigBuilder(cdpApiKey: cdpApiKey)
            .migrationSiteId(siteId)
            .autoTrackUIKitScreenViews()
            .autoTrackDeviceAttributes(true)
  
        CustomerIO.initialize(withConfig: config.build())

        // Initialize messaging features - method remains the same
        MessagingPushFCM.initialize(
            withConfig: MessagingPushConfigBuilder()
                .autoFetchDeviceToken(true)
                .build()
        )

        return true
    }
}
```

## Troubleshooting

### Build errors after upgrade

If you encounter build errors after upgrading:

1.  **Clean your build**: In Xcode, go to **Product** > **Clean Build Folder**
2.  **Remove old packages**: If using SPM, remove the old packages and re-add them
3.  **Update CocoaPods**: If using CocoaPods, run `pod deintegrate` followed by `pod install`

### Import errors

If you see errors related to missing imports:

1.  Verify that `CioFirebaseWrapper` is properly added to your project dependencies
2.  Check that the file initializing FCM functionality has both `import CioFirebaseWrapper` and `import CioMessagingPushFCM`

---

## Whats new > 4.4.0 upgrade

**Source:** /integrations/sdk/ios/whats-new/4.4.0-upgrade

# Upgrade from 4.x to 4.4.0

Version 4.4.0 adds App Groups support for more reliable push delivery metric tracking. This update is additive—existing integrations work without modification.

## What changed?

Version 4.4.0 adds support for [App Groups](/integrations/sdk/ios/push/app-groups/), which improves the reliability of push delivery metric tracking. This update is additive—your existing integration continues to work without changes. However, to take advantage of App Groups, you’ll need to update your Xcode project configuration and regenerate provisioning profiles if you use manual signing.

### Why App Groups?

When you send a push notification, the SDK tracks delivery metrics in your Notification Service Extension (NSE). However, iOS can kill the NSE before the tracking request completes, which means some delivery data may never reach Customer.io. App Groups provide shared storage between your main app and the NSE, so the SDK can save metrics and recover them on the next app launch.

## Upgrade process

1.  Update to version 4.4.0 or later of the Customer.io iOS SDK.
2.  Follow the [App Groups setup instructions](/integrations/sdk/ios/push/app-groups/) to configure your Xcode project and pass the `.appGroupId()` to the SDK.

No other code changes are required.

---

## Whats new > 5.0.0 upgrade

**Source:** /integrations/sdk/ios/whats-new/5.0.0-upgrade

# Upgrade from 4.x to 5.0.0

Version 5.0.0 of the iOS SDK requires iOS 15 or later. If you send push notifications through Firebase Cloud Messaging (FCM), you now get the `CioFirebaseWrapper` package from `customerio-ios` instead of `customerio-ios-fcm`.

## What changed?

Version 5.0.0 has two changes that can affect your app:

*   **iOS 15 or later**: The SDK now requires iOS 15 or later. If your app needs to support iOS 13 or 14, stay on version 4.x.
*   **`CioFirebaseWrapper` moved into `customerio-ios`**: If you use FCM, you now get `CioFirebaseWrapper` from the `customerio-ios` package, and it has the same version number as the rest of the SDK. The separate `customerio-ios-fcm` package only works with SDK versions before 5.0.0, so you need to remove it.

If you send push notifications through Apple Push Notification service (APNs), the new iOS minimum is the only change that affects you. Your app doesn’t need Firebase.

You don’t need to change your code. Your import statements and your `MessagingPushFCM.initialize` call stay the same.

## Upgrade process

### 1\. Raise your deployment target to iOS 15

In Xcode, set the minimum deployment target to iOS 15.0 or later for your app and for any app extension that uses the SDK, like your Notification Service Extension.

If you use CocoaPods, update the platform in your `Podfile` too:

```
platform :ios, '15.0'
```

### 2\. Update your dependencies

Swift Package Manager (SPM)CocoaPods

#### Swift Package Manager (SPM)

1.  If you added the `customerio-ios-fcm` package, remove it. In Xcode, select your project, go to **Package Dependencies**, select `customerio-ios-fcm`, and click **\-**. Swift Package Manager can’t resolve `customerio-ios` 5.0.0 while `customerio-ios-fcm` is still in your project.
2.  Update `customerio-ios` to version 5.0.0 or later. If you use the *Up to Next Major Version* dependency rule, set it to start at 5.0.0.
3.  If you use FCM, add the `CioFirebaseWrapper` product from `customerio-ios` to your app target. Select your app target, go to **General** > **Frameworks, Libraries, and Embedded Content**, click **+**, and select `CioFirebaseWrapper`.
4.  If you use FCM, make sure your app includes the `FirebaseMessaging` product from `https://github.com/firebase/firebase-ios-sdk`, version 8.7.0 or later. The `customerio-ios-fcm` package added Firebase to your app for you, but `customerio-ios` doesn’t. If your app doesn’t have `FirebaseMessaging` yet, add it.

#### CocoaPods

1.  If you set versions for your Customer.io pods in your `Podfile`, change them to `'~> 5.0'`.
    
2.  If you use FCM, update `CioFirebaseWrapper` in your `Podfile`:
    
    ```
    pod 'CioFirebaseWrapper', '~> 5.0'
    ```
    
    This pod also installs `FirebaseMessaging`. If your app gets Firebase another way, like through Swift Package Manager, use `pod 'CioFirebaseWrapper/Core', '~> 5.0'` instead. It installs `CioFirebaseWrapper` without Firebase.
    
3.  Update your pods. If you use FCM, run:
    
    ```
    pod update CustomerIO CioFirebaseWrapper
    ```
    
    If you use APNs, run `pod update CustomerIO`.
    
    These commands assume that your `Podfile` lists `CustomerIO/...` pods, like `CustomerIO/DataPipelines`. If it lists standalone pods instead, like `CustomerIODataPipelines`, pass those pod names to `pod update`.
    

### 3\. Check that Firebase is linked (FCM only)

The SDK finds `FirebaseMessaging` in your app when your app runs. If your app doesn’t link `FirebaseMessaging` when you call `MessagingPushFCM.initialize`, the SDK stops your app with an error that tells you to add it. Check this if you use Swift Package Manager or `CioFirebaseWrapper/Core`, because neither one installs Firebase for you.

If your app links Firebase statically, make sure your app target includes `-ObjC` in **Build Settings** > **Other Linker Flags**.

---

## Whats new > Changelog

**Source:** /integrations/sdk/ios/whats-new/changelog

# iOS Changelog

Check out release history for stable releases of iOS SDKs. Stable releases have been tested thoroughly and are ready for use in your production apps.

Need to upgrade?

Select your current version to see everything that changed between it and the latest iOS release.

Select a version…5.3.05.2.15.2.05.1.35.1.25.1.15.1.05.0.04.13.04.12.34.12.24.12.14.12.04.11.04.10.04.9.04.8.14.8.04.7.94.7.84.7.74.7.64.7.54.7.44.7.34.7.24.7.14.7.04.6.14.6.04.5.34.5.24.5.14.5.04.4.34.4.24.4.14.4.04.3.14.3.04.2.04.1.24.1.14.1.04.0.03.14.03.13.13.13.03.12.03.11.03.10.93.10.83.10.73.10.63.10.53.10.43.10.33.10.23.10.13.10.03.9.03.8.23.8.13.8.03.7.23.7.13.7.03.6.03.5.13.5.03.4.13.4.03.3.33.3.23.3.13.3.03.2.33.2.23.2.13.2.03.1.33.1.23.1.13.1.03.0.23.0.13.0.02.14.22.14.12.14.02.13.22.13.12.13.02.12.52.12.42.12.32.12.22.12.12.12.02.11.12.11.02.10.22.10.12.10.02.9.22.9.12.9.02.8.52.8.42.8.32.8.22.8.12.8.02.7.82.7.72.7.62.7.52.7.42.7.32.7.22.7.12.7.02.6.12.6.02.5.32.5.22.5.12.5.02.4.12.4.02.3.02.2.02.1.22.1.12.1.02.1.0-beta.22.1.0-beta.12.0.62.0.52.0.42.0.32.0.22.0.12.0.02.0.0-beta.12.0.0-alpha.22.0.0-alpha.11.2.91.2.81.2.71.2.61.2.51.2.41.2.31.2.21.2.11.2.01.2.0-beta.41.2.0-beta.31.2.0-beta.21.2.0-beta.11.2.0-alpha.41.2.0-alpha.31.2.0-alpha.21.2.0-alpha.11.1.11.1.01.1.0-beta.11.1.0-alpha.31.1.0-alpha.21.1.0-alpha.11.0.31.0.21.0.11.0.01.0.0-beta.31.0.0-beta.21.0.0-alpha.331.0.0-alpha.321.0.0-alpha.311.0.0-alpha.301.0.0-alpha.291.0.0-alpha.281.0.0-alpha.271.0.0-alpha.261.0.0-alpha.251.0.0-alpha.241.0.0-alpha.231.0.0-alpha.221.0.0-beta.11.0.0-alpha.211.0.0-alpha.201.0.0-alpha.191.0.0-alpha.181.0.0-alpha.171.0.0-alpha.161.0.0-alpha.151.0.0-alpha.141.0.0-alpha.131.0.0-alpha.121.0.0-alpha.111.0.0-alpha.101.0.0-alpha.91.0.0-alpha.81.0.0-alpha.71.0.0-alpha.61.0.0-alpha.51.0.0-alpha.41.0.0-alpha.31.0.0-alpha.21.0.0-alpha.1

## 5.x Releases

* * *

### 5.3.0

November 16, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/5.3.0)

#### Features

*   **datapipeline:** report the APNs environment as a device attribute ([#1395](https://github.com/customerio/customerio-ios/issues/1395)) ([e4aba46](https://github.com/customerio/customerio-ios/commit/e4aba4669ddf53a92d453dc957af7843caa61c4c))

#### Behavior changes

*   The SDK now reports the app's APNs environment (`sandbox` or `production`) as the `apns_environment` device attribute, so Customer.io can send pushes to the matching APNs server. It's sent even when `autoTrackDeviceAttributes` is off.

### 5.2.1

November 11, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/5.2.1)

#### Bug Fixes

*   **datapipeline:** refresh push\_enabled when the app becomes active ([#1394](https://github.com/customerio/customerio-ios/issues/1394)) ([059513c](https://github.com/customerio/customerio-ios/commit/059513ce2bfc72c8ea3289ca6ac1b7b94b92825f))

#### Behavior changes

*   For identified profiles, `push_enabled` is now checked each time the app becomes active, and a device update is sent only when the value changes.
*   Provisional and ephemeral notification authorization now count as `push_enabled: true`, since those notifications are delivered. Affected devices switch from `false` to `true` on their next app launch. If you segment on `push_enabled`, review those segments.
*   A `push_enabled` value you set with `setDeviceAttributes` is kept until the notification permission changes.

### 5.2.0

November 10, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/5.2.0)

#### Features

*   support silent push data and delivered receipts ([#1388](https://github.com/customerio/customerio-ios/issues/1388)) ([802c0f5](https://github.com/customerio/customerio-ios/commit/802c0f5b12389fdf759c2cffe53491f8e27a7673))

### 5.1.3

October 28, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/5.1.3)

#### Bug Fixes

*   keep in-app modal content visible when the keyboard opens ([#1364](https://github.com/customerio/customerio-ios/issues/1364)) ([737ba84](https://github.com/customerio/customerio-ios/commit/737ba8433c962e5750521ec3f6b13e9e99235eec))

### 5.1.2

October 27, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/5.1.2)

#### Bug Fixes

*   **in-app:** SSE and queue fetch fixes for user switch, anonymous identify, foreground ([#1368](https://github.com/customerio/customerio-ios/issues/1368)) ([2650ff4](https://github.com/customerio/customerio-ios/commit/2650ff49805e59a481665cca3d6435268b36e758))
    *   In-app messages sent right after `identify` now arrive over SSE without backgrounding the app. Previously, the SSE connection could stay on the anonymous profile.
    *   Switching users without calling `clearIdentify` now resets in-app state and reconnects SSE as the new user.
    *   When SSE isn't used, the SDK now fetches in-app messages as soon as the app returns to the foreground.
    *   Overlapping message fetches for the same user now share one request.

### 5.1.1

October 27, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/5.1.1)

#### Who this affects

*   Apps that call `MessagingPushAPN.initialize` or `MessagingPushFCM.initialize` with automatic token fetching on (the default) and don't use `CioAppDelegateWrapper`. The SDK replaced the app delegate's own `application(_:didRegisterForRemoteNotificationsWithDeviceToken:)`, and for APNs `didFailToRegisterForRemoteNotificationsWithError`, so code there stopped running, for example passing the token to another SDK. Calling `initialize` a second time also turned automatic token fetching off.
*   Your app's own callbacks now run first, then the SDK's, and initializing twice is safe. No code changes needed.
*   Apps that use `CioAppDelegateWrapper` aren't affected. That includes the React Native, Flutter and Expo setups, which pick this up with their next native iOS update.

#### Bug Fixes

*   keep the app delegate's push registration callbacks when auto-fetching the token ([#1373](https://github.com/customerio/customerio-ios/issues/1373)) ([8a4072a](https://github.com/customerio/customerio-ios/commit/8a4072aa77b375bbff9681dc0df7cd5f4e75bc28))

### 5.1.0

October 27, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/5.1.0)

#### Features

*   **MBL-2652:** let in-app start without a site ID when set up with a pk\_ key ([#1370](https://github.com/customerio/customerio-ios/issues/1370)) ([3a33261](https://github.com/customerio/customerio-ios/commit/3a33261433d8d87fc4b6aa40259cba052efba2ab))

### 5.0.0

October 26, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/5.0.0)

#### ⚠ BREAKING CHANGES

*   raise the minimum iOS version to 15 (#1335)

#### Migrating from 4.x

*   Raise your app's deployment target to iOS 15. Apps that need iOS 13 or 14 can stay on 4.x.
*   FCM apps: the separate `customerio-ios-fcm` package is retired, and `CioFirebaseWrapper` now ships in this package, versioned with the SDK.
    *   SwiftPM: remove the `customerio-ios-fcm` package and add the `CioFirebaseWrapper` product from this package. This package doesn't depend on Firebase, so add FirebaseMessaging 8.7.0 or later yourself if your app doesn't already.
    *   CocoaPods: update to `pod 'CioFirebaseWrapper', '~> 5.0'`, which brings in FirebaseMessaging (8.7.0 up to 13.x). Use `pod 'CioFirebaseWrapper/Core', '~> 5.0'` if your app gets Firebase another way.
*   CocoaPods: if you pin Customer.io pods (for example `'~> 4.0'`), change them to `'~> 5.0'`, including the Live Activities widget pods (`CustomerIOLiveActivitiesTemplates`, `CustomerIOLiveActivitiesAttributes`). Then run `pod update` with the Customer.io pod names in your `Podfile` (for example `pod update CustomerIO`, adding `CioFirebaseWrapper` for FCM).
*   APNs apps need no other change.

#### Features

*   raise the minimum iOS version to 15 ([#1335](https://github.com/customerio/customerio-ios/issues/1335)) ([ea67726](https://github.com/customerio/customerio-ios/commit/ea6772651dc35af05df6d01fed7b43cdf4a1bc5e))

## 4.x Releases

* * *

### 4.13.0

October 23, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.13.0)

#### Features

*   **Geofencing:** Adds dwell events. Set a dwell time on a geofence in Customer.io, and the SDK sends a `dwell` transition once a person has stayed inside that long, so you can reach people who actually visit instead of everyone passing by. ([#1346](https://github.com/customerio/customerio-ios/issues/1346)) ([6b45f0e](https://github.com/customerio/customerio-ios/commit/6b45f0e0a5c05c91aae05638331e067a9fca8618))
*   **Geofencing:** Exit events now include how long the visit lasted (`visitDurationSeconds`), so you can trigger automations like "left after more than 20 minutes inside". ([#1346](https://github.com/customerio/customerio-ios/issues/1346)) ([6b45f0e](https://github.com/customerio/customerio-ios/commit/6b45f0e0a5c05c91aae05638331e067a9fca8618))

### 4.12.3

October 22, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.12.3)

#### Bug Fixes

*   **Notification Service Extension.** The extension now refuses secret `sk_` keys the same way the main SDK does. With a secret key it sends no requests and shows the notification unchanged. ([#1362](https://github.com/customerio/customerio-ios/issues/1362)) ([d98314e](https://github.com/customerio/customerio-ios/commit/d98314e3192a66809097b36128a24c88f5bfbc96))

### 4.12.2

October 22, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.12.2)

#### Bug Fixes

*   track launch lifecycle events when the SDK initializes after app launch ([#1354](https://github.com/customerio/customerio-ios/issues/1354)) ([b88d612](https://github.com/customerio/customerio-ios/commit/b88d612433ab68239cf43d6adf5875f1916ce4b4))

### 4.12.1

October 22, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.12.1)

#### Bug Fixes

*   **messagingpush:** support apiHost in Notification Service Extension ([#1357](https://github.com/customerio/customerio-ios/issues/1357)) ([eca12ff](https://github.com/customerio/customerio-ios/commit/eca12ff8ae0d1f239d0169c2953d2194d5cb4953))

### 4.12.0

October 21, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.12.0)

#### Features

*   **Public API keys.** This release changes how the SDK handles API keys. The SDK now accepts the new public `pk_` key and reads your region (US or EU) from it, so you no longer need to set the region yourself. Secret `sk_` keys are refused and the SDK won't start with one, because secret keys must never ship inside an app. To upgrade, create a public `pk_` key in Customer.io and pass it where you pass your API key today. Existing keys keep working. ([#1342](https://github.com/customerio/customerio-ios/issues/1342)) ([34592d8](https://github.com/customerio/customerio-ios/commit/34592d846e53ecb5c42a4fd8de532ed37e30d5ef))

### 4.11.0

October 21, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.11.0)

#### Features

*   **messagingpush:** register with Firebase Installation ID ([#1334](https://github.com/customerio/customerio-ios/issues/1334)) ([136f01c](https://github.com/customerio/customerio-ios/commit/136f01c7b77ebbdc7df20da8da72550a84df8ccb)) FCM apps can now register [Firebase Installation ID](https://firebase.google.com/docs/cloud-messaging/manage-tokens) instead of the FCM token. It's opt-in and needs `CioFirebaseWrapper` 1.1.0+ and `FirebaseMessaging` 12.19.0+ (recommended). Apps that don't opt in keep using FCM tokens. APNs apps aren't affected. See our docs for migration guide.

#### Notes

*   Also fixes "Device Deleted" carrying the new token instead of the old one when the token changed shortly after launch.

### 4.10.0

October 8, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.10.0)

#### Features

*   **MBL-2542:** reject ak\_ keys and pick region from key ([#1326](https://github.com/customerio/customerio-ios/issues/1326)) ([3483fd8](https://github.com/customerio/customerio-ios/commit/3483fd860e5507a7d1f1ede2b116e1c7df9102ee))

### 4.9.0

September 25, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.9.0)

#### Highlights

**Polygon Geofences:** Geofences drawn as polygons in Customer.io are now supported, so enter and exit events follow the exact shape of a venue. Circle geofences behave exactly as before, no code changes are needed, and geofences cached by earlier versions keep working after the upgrade.

#### Features

*   **geofence:** support polygon geofences, detected by their drawn shape rather than the circle around it ([#1308](https://github.com/customerio/customerio-ios/issues/1308)) ([0c76d4b](https://github.com/customerio/customerio-ios/commit/0c76d4b7d9f2ff59065ad230df770ed05e399b5e))

### 4.8.1

September 16, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.8.1)

#### Bug Fixes

*   **deps:** pin LDSwiftEventSource to 3.3.0 ([#1292](https://github.com/customerio/customerio-ios/issues/1292)) ([cc19396](https://github.com/customerio/customerio-ios/commit/cc193963a4af96c79370cd9eb09f8499cb4af78c))

### 4.8.0

September 9, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.8.0)

#### Features

*   **inbox:** replace visual inbox empty-state text with a dimmed bell ([#1251](https://github.com/customerio/customerio-ios/issues/1251)) ([d5f46dd](https://github.com/customerio/customerio-ios/commit/d5f46dd8eeab98209842cbf6a66bc915c88da3fa))

### 4.7.9

September 8, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.7.9)

#### Bug Fixes

*   **deps:** update Faraday security pin to 1.10.6 ([#1257](https://github.com/customerio/customerio-ios/issues/1257)) ([b24741e](https://github.com/customerio/customerio-ios/commit/b24741e94bb88314c85ba7d5a68ae0c2e9ebce83))

### 4.7.8

September 4, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.7.8)

#### Bug Fixes

*   surface the failure reason on in-app error callback ([#1238](https://github.com/customerio/customerio-ios/issues/1238)) ([3733867](https://github.com/customerio/customerio-ios/commit/37338679d33d1f7a76e3d0fb209f5993b44fc7b4))

### 4.7.7

August 31, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.7.7)

#### Bug Fixes

*   call BaseNetwork completion handler once on transport error ([#1233](https://github.com/customerio/customerio-ios/issues/1233)) ([2a36ef2](https://github.com/customerio/customerio-ios/commit/2a36ef227e39402d85aaf31f7d2abdb9455d9598))

### 4.7.6

August 24, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.7.6)

#### Bug Fixes

*   deallocate subscribers on main thread ([#1222](https://github.com/customerio/customerio-ios/issues/1222)) ([0da3107](https://github.com/customerio/customerio-ios/commit/0da310774edede6a4328c38b259e1fa8246de5c6))

### 4.7.5

August 21, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.7.5)

#### Fixes

*   **In-App:** Added multi-app support ([#1210](https://github.com/customerio/customerio-ios/issues/1210)) ([7227169](https://github.com/customerio/customerio-ios/commit/7227169cf88208993de5e4d81afec45dd764185a))

### 4.7.4

August 18, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.7.4)

#### Bug Fixes

*   compose notification center delegates (MBL-2281) ([#1211](https://github.com/customerio/customerio-ios/issues/1211)) ([fc575b7](https://github.com/customerio/customerio-ios/commit/fc575b72ef4922c65bb0caecf7c8d5f94cd40a8d))

### 4.7.3

August 10, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.7.3)

#### Bug Fixes

*   prioritize SDK background work ([#1198](https://github.com/customerio/customerio-ios/issues/1198)) ([d9a745e](https://github.com/customerio/customerio-ios/commit/d9a745efc31c03bc8fc0207d75b57e5ba4da1294))

### 4.7.2

August 6, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.7.2)

#### Bug Fixes

*   **Geofence:** More reliable region monitoring: Fixes cases where enter/exit events could be missed after a background sync ([#1190](https://github.com/customerio/customerio-ios/issues/1190)) ([0594e20](https://github.com/customerio/customerio-ios/commit/0594e20e3a8cef2b129e5d3bc09c63e7613c0d5d))
*   **Geofence:** Exit events are no longer missed for large geofences the device is already inside ([#1191](https://github.com/customerio/customerio-ios/issues/1191)) ([dd52c8c](https://github.com/customerio/customerio-ios/commit/dd52c8c8a8439eeea2d18d6b45353d654974928f))
*   **Geofence:** Prevent duplicate or missing events when the set of monitored geofences changes ([#1193](https://github.com/customerio/customerio-ios/issues/1193)) ([4f6bd8b](https://github.com/customerio/customerio-ios/commit/4f6bd8bb31ca784f04555429e4e6406cceed98c1))

### 4.7.1

August 5, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.7.1)

#### Bug Fixes

*   **in-app:** stop corrupting escaped regex in page route rules ([#1174](https://github.com/customerio/customerio-ios/issues/1174)) ([00e81bb](https://github.com/customerio/customerio-ios/commit/00e81bb522ab1257d2cddee4300bc1e04c6cc2ca))

### 4.7.0

July 30, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.7.0)

#### Features

*   enable Live Activities ([#1165](https://github.com/customerio/customerio-ios/issues/1165)) ([4311539](https://github.com/customerio/customerio-ios/commit/43115395d8eed3d6a423a7b4477fe79c54034e00))
*   **geofence:** add support for geofencing feature ([#1130](https://github.com/customerio/customerio-ios/issues/1130)) ([4d82f15](https://github.com/customerio/customerio-ios/commit/4d82f1538da1478e99b419653848dacd7e0c5b8d))
*   Visual Notification Inbox overlay (integration / build distribution) ([#1141](https://github.com/customerio/customerio-ios/issues/1141)) ([74217fd](https://github.com/customerio/customerio-ios/commit/74217fdacdc5fee035c869acf2af2b8b933fb8ae))

### 4.6.1

July 24, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.6.1)

#### Bug Fixes

*   preserve wrapped app delegate protocol conformance ([#1163](https://github.com/customerio/customerio-ios/issues/1163)) ([3852901](https://github.com/customerio/customerio-ios/commit/3852901921abaa3529f6a5bd07a901f150e6c87f))

### 4.6.0

July 6, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.6.0)

#### Features

*   **in-app:** add dark mode support for in-app messages ([#1131](https://github.com/customerio/customerio-ios/issues/1131)) ([f92d058](https://github.com/customerio/customerio-ios/commit/f92d058b40be00492757f5343f00d317d6e53a3e))

### 4.5.3

June 22, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.5.3)

#### Bug Fixes

*   Resolve duplicate event delivery bugs ([#1099](https://github.com/customerio/customerio-ios/issues/1099)) ([8aacf3a](https://github.com/customerio/customerio-ios/commit/8aacf3ac782e9c7914e1e4158832489c19390b5b))

### 4.5.2

June 16, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.5.2)

#### Bug Fixes

*   Corrected SSE Heartbeat test ([#1097](https://github.com/customerio/customerio-ios/issues/1097)) ([ac4659c](https://github.com/customerio/customerio-ios/commit/ac4659caffa82bae339f3538b6f765c32a2617a1))

### 4.5.1

June 15, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.5.1)

#### Bug Fixes

*   move generated mocks into per-module mock targets (test isolation) ([#1093](https://github.com/customerio/customerio-ios/issues/1093)) ([6539766](https://github.com/customerio/customerio-ios/commit/65397666d4e82eeec788ade4fb4aea19c876890a))

### 4.5.0

June 5, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.5.0)

#### Features

*   dedup identify calls within a session when no traits supplied ([#1080](https://github.com/customerio/customerio-ios/issues/1080)) ([174e133](https://github.com/customerio/customerio-ios/commit/174e13316cc47df627b8ef71960f1d33433df80f))

### 4.4.3

May 8, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.4.3)

#### Bug Fixes

*   Re-exported `CioInternalCommon` to allow `CustomerIO` extensions without additional imports ([#1041](https://github.com/customerio/customerio-ios/issues/1041)) ([937ba8e](https://github.com/customerio/customerio-ios/commit/937ba8ea1c7cae157e9dca41a198c17c07cf7879))

### 4.4.2

May 6, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.4.2)

#### Bug Fixes

*   Fixed duplicate completion handler call crash ([#1040](https://github.com/customerio/customerio-ios/issues/1040)) ([eddd38c](https://github.com/customerio/customerio-ios/commit/eddd38c932a9b874951fa5d0183b5b3f9959e12a))

### 4.4.1

April 14, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.4.1)

#### Bug Fixes

*   Fix in-app messages not displaying when app returns from background when SSE enabled ([#1031](https://github.com/customerio/customerio-ios/issues/1031)) ([a7e586f](https://github.com/customerio/customerio-ios/commit/a7e586fca1453a8c0a6b48954c30521a6ee899fd))

### 4.4.0

April 2, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.4.0)

#### Features

*   Push delivery reslience improvement ([#1030](https://github.com/customerio/customerio-ios/issues/1030)) ([2d6379d](https://github.com/customerio/customerio-ios/commit/2d6379d36e1cddbd7890677934586b27fc787f97))

### 4.3.1

March 10, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.3.1)

#### Bug Fixes

*   Do not log errors when removing files that doesn't exist ([#1022](https://github.com/customerio/customerio-ios/issues/1022)) ([f67eab4](https://github.com/customerio/customerio-ios/commit/f67eab450553950011f8f71f2814f4296db46170))

### 4.3.0

March 9, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.3.0)

#### Features

*   Location enrichment ([#1019](https://github.com/customerio/customerio-ios/issues/1019)) ([6f0549d](https://github.com/customerio/customerio-ios/commit/6f0549d7b8db95c6452b5f510322aa990c5fec8d))

### 4.2.0

February 20, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.2.0)

#### Features

*   Added support for Notification Inbox ([#1011](https://github.com/customerio/customerio-ios/issues/1011)) ([d84c8b6](https://github.com/customerio/customerio-ios/commit/d84c8b65569bd7598882c21c6890b4dd9d68ac68))

### 4.1.2

February 5, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.1.2)

#### Bug Fixes

*   Crash in swizzled didRegisterForRemoteNotificationsWithDeviceToken for FCM ([#990](https://github.com/customerio/customerio-ios/issues/990)) ([13d4d43](https://github.com/customerio/customerio-ios/commit/13d4d43f725b1052c449c41bcc1f96fb5b0d935b))

### 4.1.1

January 26, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.1.1)

#### Bug Fixes

*   Fixed intermittent test failure and crashing of the EventBusHandler ([#982](https://github.com/customerio/customerio-ios/issues/982)) ([d045741](https://github.com/customerio/customerio-ios/commit/d0457411479ab93b1618bb183ac19e4d6a17602e))

### 4.1.0

January 13, 2026 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.1.0)

#### Features

*   In-app messages now support SSE (Server-Sent Events) as an alternative to polling, reducing latency and improving message delivery efficiency ([#975](https://github.com/customerio/customerio-ios/issues/975)) ([c8345c5](https://github.com/customerio/customerio-ios/commit/c8345c526d3bdb83dd77428a7d433191b01c4aba))

### 4.0.0

October 16, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/4.0.0)

#### ⚠ BREAKING CHANGES

*   Move Firebase direct depdency out of main iOS SDK ([#960](https://github.com/customerio/customerio-ios/issues/960)) ([361964e](https://github.com/customerio/customerio-ios/commit/361964edc4628590ad896dcbf6a3b1ca82cd20bb))

## 3.x Releases

* * *

### 3.14.0

October 8, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.14.0)

#### Features

*   You can now send banners, modals, pop-ups, and surveys to anonymous visitors —no ID or email required.([#956](https://github.com/customerio/customerio-ios/issues/956)) ([ca93707](https://github.com/customerio/customerio-ios/commit/ca93707b5471ea5ceb0ec40a9a78e32dcb8eda26))

### 3.13.1

August 27, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.13.1)

#### Bug Fixes

*   Fixed build issues on Xcode 26 beta that only affected apps using CocoaPods ([#949](https://github.com/customerio/customerio-ios/issues/949)) ([f5674b5](https://github.com/customerio/customerio-ios/commit/f5674b5ef7eedcbe9f8512a654e8fc0b773b8447))
*   Fixed an issue where custom scheme URLs were not opening when using FCM with `CioAppDelegateWrapper` ([#950](https://github.com/customerio/customerio-ios/pull/950)) ([795bdf1](https://github.com/customerio/customerio-ios/commit/795bdf126260332a05f6b41f1619dfc2ce778e02))

### 3.13.0

August 21, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.13.0)

#### Features

*   Align public API with other CIO SDK platforms ([#948](https://github.com/customerio/customerio-ios/issues/948)) ([b63efd7](https://github.com/customerio/customerio-ios/commit/b63efd789f27afe803a879e500ed28fabb344f14))

### 3.12.0

August 18, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.12.0)

#### Features

*   Added support for queue sticky sessions ([#946](https://github.com/customerio/customerio-ios/issues/946)) ([4b42003](https://github.com/customerio/customerio-ios/commit/4b420032758794ed2874aa921e1907452a29c9d6))

### 3.11.0

July 22, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.11.0)

#### ⚠️ BREAKING TOOLING CHANGES

*   Support for FCM 12.x is added which requires a minimum iOS deployment target of 15. If you're using FCM module, ensure your deployment target and tooling are up to date. Or lock Firebase to 11.x to avoid compatibility issues ([#938](https://github.com/customerio/customerio-ios/issues/938)) ([3a417ec](https://github.com/customerio/customerio-ios/commit/3a417ecc8d77cb77b0cf38c2b6d77d22c884b8d9))

### 3.10.9

July 21, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.10.9)

#### Bug Fixes

*   Fixed build issue by adding a default implementation for an internal SPI method in `DeepLinkUtil`, preventing conformance errors with `BUILD_LIBRARY_FOR_DISTRIBUTION = YES` ([#936](https://github.com/customerio/customerio-ios/issues/936)) ([c7ba900](https://github.com/customerio/customerio-ios/commit/c7ba900e4e5d1c17e8fd598b645784d2f7e95c00))

### 3.10.8

July 8, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.10.8)

#### Bug Fixes

*   Preserve numeric types when doing sanitization for JSON ([#935](https://github.com/customerio/customerio-ios/issues/935)) ([cbf95fd](https://github.com/customerio/customerio-ios/commit/cbf95fdbdf72142f5b711ce9e0cb0ad81835ff41))

### 3.10.7

June 26, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.10.7)

#### Internal

*   Added base classes around Inline views to support communication of inline view with Wrapper SDKs ([#933](https://github.com/customerio/customerio-ios/issues/933)) ([2a4dbb9](https://github.com/customerio/customerio-ios/commit/2a4dbb98a8cfe6a3eea6e5fd6adf61a0015d0fb8))

### 3.10.6

June 25, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.10.6)

#### Bug Fixes

*   Sanitize unsupported numeric values ([#930](https://github.com/customerio/customerio-ios/issues/930)) ([2a848e4](https://github.com/customerio/customerio-ios/commit/2a848e4ad5b2e9b215f23339bf29c9ffddd6d18e))

### 3.10.5

June 4, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.10.5)

#### Bug Fixes

*   Fix in-app messages not overlaying safe area top and bottom ([#925](https://github.com/customerio/customerio-ios/issues/925)) ([8ed7d7b](https://github.com/customerio/customerio-ios/commit/8ed7d7b828a38eb4c6bdffd5db0ccaa5ddf0cd72))

### 3.10.4

June 2, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.10.4)

#### Bug Fixes

*   Fixed an issue where the SDK enforced a strict version of firebase messaging, preventing integration with newer versions. ([#929](https://github.com/customerio/customerio-ios/issues/929)) ([a0211d3](https://github.com/customerio/customerio-ios/commit/a0211d32739bc54eb6e503e4ad1846d14ddaa241))

### 3.10.3

May 30, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.10.3)

#### Bug Fixes

*   premature deallocation of the rich push http client ([1edb75c](https://github.com/customerio/customerio-ios/commit/1edb75c141fbc20e42266f2a27c0ea0ff5fdb7e9))
*   premature deallocation of the rich push http client ([#924](https://github.com/customerio/customerio-ios/issues/924)) ([9a985c1](https://github.com/customerio/customerio-ios/commit/9a985c1830990a8a2e68a44da5f7dbf4b7f47f62))

### 3.10.2

May 27, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.10.2)

#### Bug Fixes

*   Fixes the bug where multi screen in-app messages might dismiss earlier ([#920](https://github.com/customerio/customerio-ios/issues/920)) ([0426e06](https://github.com/customerio/customerio-ios/commit/0426e0614c20b5aea68c8faebcdd60a5a557959a))

### 3.10.1

May 26, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.10.1)

#### Bug Fixes

*   Fixed an issue that caused duplicate internal calls for setting device tokens ([#922](https://github.com/customerio/customerio-ios/issues/922)) ([0f5d7f0](https://github.com/customerio/customerio-ios/commit/0f5d7f01bdeaeaf8fb324367a5f0df110f64e301))
*   Improved detection of UNUserNotificationCenterDelegate method implementations by explicitly tracking completion handler calls, ensuring more reliable notification handling across different integration scenarios ([#922](https://github.com/customerio/customerio-ios/issues/922)) ([0f5d7f0](https://github.com/customerio/customerio-ios/commit/0f5d7f01bdeaeaf8fb324367a5f0df110f64e301))

### 3.10.0

May 23, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.10.0)

⚠ BREAKING TOOLING CHANGES

*   Support for FCM `11.12.0` ([#918](https://github.com/customerio/customerio-ios/issues/918)) ([dcc21e0](https://github.com/customerio/customerio-ios/commit/dcc21e0a0f881b31057c379a935ab24a948d0069)) is added which requires Xcode 16.2 or later, so you will need to update xcode if you are utilizing the FCM module.

### 3.9.0

May 15, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.9.0)

#### Improvements

*   **Swizzling replacement**:
    *   We've replaced the old "swizzling" method for handling push notifications with a clearer, more reliable system.
    *   New AppDelegate classes (`CioAppDelegate` and `CioAppDelegateWrapper`) make integration easier, more explicit, and more maintainable.
*   **Deep Linking**:
    *   Added a new `deepLinkingCallback` to fix issues with some libraries (like Firebase) that don’t properly handle `application(_:continue:restorationHandler:)`.
    *   This ensures deep links work more consistently across different setups.
*   **Sample Applications**:
    *   Updated to show how to implement the new AppDelegate setup and deep linking — making it easier to follow and integrate.

#### Deprecations

*   The old swizzling-based push notification setup is now deprecated. It still works, but we recommend switching to the new method as it will be removed in a future release.
*   The previous deep-linking approach is also deprecated, replaced by the new `deepLinkingCallback`.

### 3.8.2

April 22, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.8.2)

#### Bug Fixes

*   Parse region leniently and fall back to default region if parsing fails instead of blocking initialization ([#879](https://github.com/customerio/customerio-ios/pull/879))
*   Hardcoded the upper limit of FCM version to avoid the issues with compilation of Cocoapods SDK (#880)

### 3.8.1

April 2, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.8.1)

#### Bug Fixes

*   Fixed an issue where the “Application Installed” event was incorrectly triggered on every app launch instead of only after the initial installation.

#### Improvement

*   Updated libraries to the latest versions to improve stability.

### 3.8.0

January 30, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.8.0)

#### Features

*   Added support for inline in-app messages. Inline in-app messages act like a part of the content on your page. They let you dynamically populate parts of your app and talk to your customers without interrupting their experience. ([#864](https://github.com/customerio/customerio-ios/issues/864)) ([35fba9b](https://github.com/customerio/customerio-ios/commit/35fba9b8171ca50138553d2c2d6a87a747a90c49))

#### Fixes

*   Incorrectly scrolling content for in-app modal messages positioned top/bottom. #858

### 3.7.2

January 8, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.7.2)

#### Bug Fixes

*   Fixes in-app messages overlay background color being ignored from in-app message payload ([#843](https://github.com/customerio/customerio-ios/issues/843))

### 3.7.1

January 6, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.7.1)

#### Bug Fixes

*   Fixes the intermittent crash with in-app messages when triggered on background thread ([#840](https://github.com/customerio/customerio-ios/issues/840)) ([93200a4](https://github.com/customerio/customerio-ios/commit/93200a420d589962d12c618f63b64dce03c8940b))

### 3.7.0

January 1, 2025 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.7.0)

#### Features

*   Added ability to disable forwarding screen events to destinations/servers. Apps can still send screen events for local processing and use them for page rules in in-app messages by just updating SDK configuration during initialization. ([#844](https://github.com/customerio/customerio-ios/issues/844)) ([486e228](https://github.com/customerio/customerio-ios/commit/486e2281f91715fcbcfa9dbde01743329e838fda))

#### Fixes

*   Handle fragments (#) when you open a web page from in-app via "Open the web" action. #842

### 3.6.0

November 13, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.6.0)

#### Features

*   This release introduces support for displaying larger in-app messages. ([#831](https://github.com/customerio/customerio-ios/issues/831)) ([3731f68](https://github.com/customerio/customerio-ios/commit/3731f685a19bd1e9840c53ab3bcd70e37deac182))

#### Fixes

*   Resolve an issue that prevented push metrics from being reported for customers who set the region to the EU region. ([https://github.com/customerio/customerio-ios/pull/836](https://github.com/customerio/customerio-ios/pull/836))

#### Improvement

*   Updated our SDK to use the v2 version of our in-app messages API. This will provide a more reliable experience for in-app messages. ([https://github.com/customerio/customerio-ios/pull/834](https://github.com/customerio/customerio-ios/pull/834))

### 3.5.1

October 25, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.5.1)

#### Bug Fixes

*   This fix dismisses keyboard when an in-app message appears to allow uninterrupted user interaction ([#828](https://github.com/customerio/customerio-ios/issues/828)) ([faad28a](https://github.com/customerio/customerio-ios/commit/faad28a02f085b5f4a334bc9122dbfe862e38119))

### 3.5.0

October 16, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.5.0)

#### Improvement

*   This release includes changes needed to support for data pipelines in the our React Native SDK. There are no new features for customers utilizing our native Android SDK only. ([#819](https://github.com/customerio/customerio-ios/issues/819)) ([171dfdc](https://github.com/customerio/customerio-ios/commit/171dfdc45a43f9560f24ae2d7ea2dcd3b71297c8))

### 3.4.1

October 1, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.4.1)

#### Features

*   This update extends support to newer Firebase SDK versions. ([#792](https://github.com/customerio/customerio-ios/pull/817))

#### Bug Fixes

*   Fixes an edge case where the in-app queue would not maintain its integrity when `autoScreenTracking` is turned on and screens are frequently changed. ([#820](https://github.com/customerio/customerio-ios/issues/820)) ([62268a4](https://github.com/customerio/customerio-ios/commit/62268a4a3248ba62f7898f6a0cb25e9e7cb5d015))

### 3.4.0

September 17, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.4.0)

#### Features

*   Revamped the in-app messaging module to enhance performance by optimizing local processing, accelerating message loading during page transitions, and implementing a state-driven architecture for better responsiveness and control. \[[#815](https://github.com/customerio/customerio-ios/issues/815)\] ([5cd651b](https://github.com/customerio/customerio-ios/commit/5cd651b0cc9a3593bdc1e782565bcf89ede87eb3))
*   We highly recommend upgrading to the new in-app editor to ensure optimal performance.

#### Fixes

*   We reduced the chance of duplicate in-app messages by keeping a local store of messages already displayed.

### 3.3.3

August 8, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.3.3)

#### Bug Fixes

*   Resolved issue for customers who use the tool, Tuist, to install the Customer.io iOS SDK. ([#791](https://github.com/customerio/customerio-ios/issues/791)) ([cd1346a](https://github.com/customerio/customerio-ios/commit/cd1346a8ee9bd7c0b81c7e92d4ffc7507a904d9f))

### 3.3.2

June 27, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.3.2)

#### Bug Fixes

*   This release addresses a compatibility issue for apps that have installed two or more third-party SDKs (besides Customer.io SDK) that handle push notifications. While this issue was primarily reported by our Flutter customers, it could also affect native iOS and React Native applications. ([#751](https://github.com/customerio/customerio-ios/issues/751)) ([ca5abb3](https://github.com/customerio/customerio-ios/commit/ca5abb349f4006a6de5f5b9c1355c7f422877c7c))

### 3.3.1

June 25, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.3.1)

#### Bug Fixes

*   This release resolves a scenario where in-app messages with page rules enabled are sent to a device but is never shown if the app is killed and re-opened. ([#746](https://github.com/customerio/customerio-ios/issues/746)) ([cfae57d](https://github.com/customerio/customerio-ios/commit/cfae57d1b675865ca980c22f52abaeee9c9baa33))

### 3.3.0

June 17, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.3.0)

#### Features

*   When using page rules and when an in-app messages need a second to load, the in-app message might appear after a user navigates to another page. We made changes to ensure the page-rules are checked after the message is loaded and immediately before it’s displayed in order to resolve this issue. ([#731](https://github.com/customerio/customerio-ios/issues/731)) ([cb1d014](https://github.com/customerio/customerio-ios/commit/cb1d014d52f7c53af6650e185857ba0e5468db49))

### 3.2.3

June 13, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.2.3)

#### Bug Fixes

*   For users of our [Flutter SDK](https://github.com/customerio/customerio-flutter) and [React Native SDK](https://github.com/customerio/customerio-reactnative), this resolves a compatibility issue with 3rd party FCM Flutter and React Native SDKs. In some cases, the issue prevented push notifications from showing while the app was in the foreground when the 3rd party SDK and CIO SDK were both installed. ([#736](https://github.com/customerio/customerio-ios/issues/736)) ([ccb0f47](https://github.com/customerio/customerio-ios/commit/ccb0f47297cca52c5023d149a325d9099dbdccd8))

### 3.2.2

May 29, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.2.2)

#### Bug Fixes

*   Resolves an issue that prevented actions from being tracked for in-app messages. ([#728](https://github.com/customerio/customerio-ios/issues/728)) ([c1f69c1](https://github.com/customerio/customerio-ios/commit/c1f69c167205238673265eda60aa5183bf14181a))

### 3.2.1

May 27, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.2.1)

#### Bug Fixes

*   Resolves an issue that caused a crash on the emulator while in developing. ([#725](https://github.com/customerio/customerio-ios/issues/725)) ([7ca2dc2](https://github.com/customerio/customerio-ios/commit/7ca2dc2fb8b65bb5f01dbbe7fc14ec2c0b1b7031))

### 3.2.0

May 7, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.2.0)

#### Features

*   Segment compatibility ([#685](https://github.com/customerio/customerio-ios/issues/685)) ([7298783](https://github.com/customerio/customerio-ios/commit/7298783adb888c014f30f04eb4d20e4bc6e9d810))

### 3.1.3

April 24, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.1.3)

#### Bug Fixes

*   update segment internal SPM dependencies with fixed version ([#708](https://github.com/customerio/customerio-ios/issues/708)) ([c02742e](https://github.com/customerio/customerio-ios/commit/c02742eed420bd40d87bf4bf22d6a7e7727cdaab))

### 3.1.2

April 16, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.1.2)

#### Bug Fixes

*   track bq migration for identify profile events with no attributes ([2fb4827](https://github.com/customerio/customerio-ios/commit/2fb4827ff0e59329e5bb2fc185b0e5781544c58a))

### 3.1.1

April 15, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.1.1)

#### Bug Fixes

*   added alias for Region ([#693](https://github.com/customerio/customerio-ios/issues/693)) ([1619c72](https://github.com/customerio/customerio-ios/commit/1619c72e9acbf0b95fa0d7e5f8e25bf4fd2fc1d2))

### 3.1.0

April 10, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.1.0)

#### Features

*   privacy manifest files ([#677](https://github.com/customerio/customerio-ios/issues/677)) ([e5c6dc7](https://github.com/customerio/customerio-ios/commit/e5c6dc7b6841ca31c02f2bd61cd49dc9c6604055))

### 3.0.2

April 9, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.0.2)

#### Bug Fixes

*   \[visionos\] Minor project cleanup ([#688](https://github.com/customerio/customerio-ios/issues/688)) ([d2934fe](https://github.com/customerio/customerio-ios/commit/d2934fe1ad5255f35568411ee0c5362c052cd7ed))

### 3.0.1

March 21, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.0.1)

#### Bug Fixes

*   install 3.0 with Swift Package Manager from Xcode ([#660](https://github.com/customerio/customerio-ios/issues/660)) ([45b0367](https://github.com/customerio/customerio-ios/commit/45b0367451b81aae952ee4f248226be48a37650f))

### 3.0.0

March 20, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/3.0.0)

#### ⚠ BREAKING CHANGES

*   iOS as a source for Data Pipelines (#659)

#### Features

*   iOS as a source for Data Pipelines ([#659](https://github.com/customerio/customerio-ios/issues/659)) ([0a68373](https://github.com/customerio/customerio-ios/commit/0a683732a8eea6372445b30c4bcce2f1dc9caa86))
*   migration module to cater to all migration tasks ([#530](https://github.com/customerio/customerio-ios/issues/530)) ([2feb1d4](https://github.com/customerio/customerio-ios/commit/2feb1d4af49d1cf80ef1eecacb7ce2ea0a7881c9))

#### Bug Fixes

*   add attributes to properties ([#649](https://github.com/customerio/customerio-ios/issues/649)) ([4b02e92](https://github.com/customerio/customerio-ios/commit/4b02e926e64ad3f26b111a7b7ff6a421d71203d9))
*   all sdk modules can only be initialized once ([ae46c7f](https://github.com/customerio/customerio-ios/commit/ae46c7f01c73d5db5a40d23f5959be7bf83c2e93))
*   app crash on identify method ([#458](https://github.com/customerio/customerio-ios/issues/458)) ([13e9862](https://github.com/customerio/customerio-ios/commit/13e9862b3e8161185e7f5dd823297187eb79d78a))
*   compilation for test ([f14b773](https://github.com/customerio/customerio-ios/commit/f14b77331c372689cc8d1791b625500ab4b3182b))
*   compilation issue ([420a61e](https://github.com/customerio/customerio-ios/commit/420a61e40d7a899bca7549390cbc33fbff16d7c4))
*   eventbus handler ref ([#469](https://github.com/customerio/customerio-ios/issues/469)) ([8c8ef91](https://github.com/customerio/customerio-ios/commit/8c8ef91bfbd7722ecd911f6be83a7ec5e1cc0725))
*   journey id in migration payload ([#653](https://github.com/customerio/customerio-ios/issues/653)) ([3b649c9](https://github.com/customerio/customerio-ios/commit/3b649c905946af1922665b183007b008d8bc0274))
*   prevent duplicate automatic screenview events from being tracked ([fea9ec5](https://github.com/customerio/customerio-ios/commit/fea9ec5ea498e25b24d65ef9e619790102337a0d))
*   pushEventHandler test ([dc80fc2](https://github.com/customerio/customerio-ios/commit/dc80fc2d66c290ad7080ac8e05a4cded2f729071))
*   remove occurrence of autoTrackDeviceAttributes from all push modules ([#505](https://github.com/customerio/customerio-ios/issues/505)) ([8dc6507](https://github.com/customerio/customerio-ios/commit/8dc6507582f1aed97fb80229df152f2ec152b186))
*   removed last\_used from properties ([#477](https://github.com/customerio/customerio-ios/issues/477)) ([b0b9631](https://github.com/customerio/customerio-ios/commit/b0b9631d88c558206f88d7de161ec51c7a15c2cf))
*   sample app issues ([#551](https://github.com/customerio/customerio-ios/issues/551)) ([05544b3](https://github.com/customerio/customerio-ios/commit/05544b3014b5276d21be736a9618046321967f23))
*   use git commit instead of git branch for segment dependency ([d245015](https://github.com/customerio/customerio-ios/commit/d2450154725c54898b5d08defacdd2e2f37406e8))

## 2.x Releases

* * *

### 2.14.2

October 7, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.14.2)

#### Features

*   This update extends support to the newer versions of the Firebase SDK (>11), ensuring compatibility with the latest Firebase features and improvements. ([#822](https://github.com/customerio/customerio-ios/pull/822)) ([ab53cf6](https://github.com/customerio/customerio-ios/commit/ab53cf6dacb7c197913ac39ee5d7da83e3cd41b6))

### 2.14.1

August 21, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.14.1)

#### Bug Fixes

*   Explicitly switched threads to avoid forcing identify calls to be made on main thread. The SDK now automatically switches to appropriate thread, regardless of the thread used to make identify calls. ([#795](https://github.com/customerio/customerio-ios/issues/795)) ([9fc527b](https://github.com/customerio/customerio-ios/commit/9fc527b2f8feb0e5c2d2438f8d0a950cf17ab00f))

### 2.14.0

August 21, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.14.0)

#### Features

*   Reduced the time for first in-app message to be shown for newly identified profiles. For new profiles, in-app messages are now fetched as soon as the profile is identified. ([#794](https://github.com/customerio/customerio-ios/issues/794)) ([13032c6](https://github.com/customerio/customerio-ios/commit/13032c6cbb3ea9ee11ca2a55aef322537c147525))

### 2.13.2

June 21, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.13.2)

#### Bug Fixes

*   This release addresses a compatibility issue for apps that have installed two or more third-party SDKs (besides Customer.io SDK) that handle push notifications. While this issue was primarily reported by our Flutter customers, it could also affect native iOS and React Native applications. ([#743](https://github.com/customerio/customerio-ios/issues/743)) ([c3573fc](https://github.com/customerio/customerio-ios/commit/c3573fcc79b7dc540805e51e55aadc2f5e7d452b))

### 2.13.1

June 12, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.13.1)

#### Bug Fixes

*   For users of our [Flutter SDK](https://github.com/customerio/customerio-flutter) and [React Native SDK](https://github.com/customerio/customerio-reactnative), this resolves a compatibility issue with 3rd party FCM Flutter and React Native SDKs. In some cases, the issue prevented push notifications from showing while the app was in the foreground when the 3rd party SDK and CIO SDK were both installed.([#735](https://github.com/customerio/customerio-ios/issues/735)) ([b0a7772](https://github.com/customerio/customerio-ios/commit/b0a7772e85864c7d9e4294858dcde0bc3175f75f))

### 2.13.0

April 10, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.13.0)

#### Features

*   privacy manifest files ([#679](https://github.com/customerio/customerio-ios/issues/679)) ([c801004](https://github.com/customerio/customerio-ios/commit/c801004b42b092d88be7f9f586ad59d5f23e4b86))

### 2.12.5

March 18, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.12.5)

#### Bug Fixes

*   do not bundle .md files in cocoapods deployments ([15dbb48](https://github.com/customerio/customerio-ios/commit/15dbb48b942008178f5d6433fe9fc144f7c740b9))

### 2.12.4

March 13, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.12.4)

#### Bug Fixes

*   call completionHandler if push handler does not implement optional function ([9996872](https://github.com/customerio/customerio-ios/commit/9996872e774a0c0c2135a0e02a398c07ab2397f8))
*   forward push received app in foreground events to 3rd party callbacks ([bd55e2b](https://github.com/customerio/customerio-ios/commit/bd55e2b9b2aa349d7f78c1e76d22dfa1463e35ac))
*   forward push response events to 3rd party callback functions, for CIO push ([121b157](https://github.com/customerio/customerio-ios/commit/121b157457708a6ac9f971a367f85d37a1684bde))
*   open deep link from main thread as required by UIKit ([7d7867f](https://github.com/customerio/customerio-ios/commit/7d7867fa0265169daa4e62bd016dbfb3f1764d65))

### 2.12.3

March 5, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.12.3)

#### Bug Fixes

*   expo users reported app crash on didFailToRegisterForRemoteNotificationsWithError ([#575](https://github.com/customerio/customerio-ios/issues/575)) ([ac70292](https://github.com/customerio/customerio-ios/commit/ac702920fc205354715a99985eb5469f5a3d99da))

### 2.12.2

February 23, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.12.2)

#### Bug Fixes

*   rich push image downloading path conflict when its already downloaded ([#561](https://github.com/customerio/customerio-ios/issues/561)) ([67cbfd6](https://github.com/customerio/customerio-ios/commit/67cbfd6b7aeb46dae8700f4bfb94817e06ad002e))

### 2.12.1

February 15, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.12.1)

#### Bug Fixes

*   fixes an issue with multiple timers being scheduled ([#529](https://github.com/customerio/customerio-ios/issues/529)) ([ec383f1](https://github.com/customerio/customerio-ios/commit/ec383f1f92d0ecf819e90a87879c9ca870e0017d))

### 2.12.0

February 15, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.12.0)

#### Features

*   use new header to set polling interval ([#519](https://github.com/customerio/customerio-ios/issues/519)) ([05a1ebd](https://github.com/customerio/customerio-ios/commit/05a1ebd475b965974b9aae60895cdaf8ac11e113))

### 2.11.1

February 14, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.11.1)

#### Bug Fixes

*   enable logging for gist ([#524](https://github.com/customerio/customerio-ios/issues/524)) ([c786897](https://github.com/customerio/customerio-ios/commit/c786897bf9ce1ba15b0c2a1c23730346f9b1e70d))

### 2.11.0

February 12, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.11.0)

#### Features

*   automatic push click handling ([#403](https://github.com/customerio/customerio-ios/issues/403)) ([47e94c4](https://github.com/customerio/customerio-ios/commit/47e94c47b562380afbe1e727c90c9a51cdb9e02b))

### 2.10.2

January 18, 2024 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.10.2)

#### Bug Fixes

*   ensure messages are only shown once ([#468](https://github.com/customerio/customerio-ios/issues/468)) ([5cc6625](https://github.com/customerio/customerio-ios/commit/5cc66250347a2202297287b989cf1993a8c4248f))

### 2.10.1

November 22, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.10.1)

#### Bug Fixes

*   cocoapods APN customers app not compiling ([#414](https://github.com/customerio/customerio-ios/issues/414)) ([e7aaa23](https://github.com/customerio/customerio-ios/commit/e7aaa23320bde6fff8aa35a1def9c6ba05602c46))

### 2.10.0

November 8, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.10.0)

#### Features

*   auto fetch device token and auto register device (apns) ([#391](https://github.com/customerio/customerio-ios/issues/391)) ([2fce84d](https://github.com/customerio/customerio-ios/commit/2fce84d0fc7801ddefcd1085b9a17b0859165d3b))

### 2.9.2

November 7, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.9.2)

#### Bug Fixes

*   memory exception during SDK initialization async tasks ([#399](https://github.com/customerio/customerio-ios/issues/399)) ([3404523](https://github.com/customerio/customerio-ios/commit/3404523677bcf4a184b50ba88390596a3615bb6e))

### 2.9.1

November 7, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.9.1)

#### Bug Fixes

*   add priority field to message and sorting by priority within local store ([#401](https://github.com/customerio/customerio-ios/issues/401)) ([8315118](https://github.com/customerio/customerio-ios/commit/83151189b7fa6829bf4eca47431e8aeba2c943fd))

### 2.9.0

October 31, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.9.0)

#### Features

*   get currently registered device token ([#398](https://github.com/customerio/customerio-ios/issues/398)) ([cdedab0](https://github.com/customerio/customerio-ios/commit/cdedab0fa9a9894789f4807fc90e7b7119ff9ae9))

### 2.8.5

October 27, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.8.5)

#### Bug Fixes

*   when queue cannot find task, expect queue runs next task ([#397](https://github.com/customerio/customerio-ios/issues/397)) ([01ea7a6](https://github.com/customerio/customerio-ios/commit/01ea7a62981de1df13b3eec44d8c6433b77c5653))

### 2.8.4

October 18, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.8.4)

#### Bug Fixes

*   in-app positioning and persistence ([#393](https://github.com/customerio/customerio-ios/issues/393)) ([b5a2f18](https://github.com/customerio/customerio-ios/commit/b5a2f18688e2d6d139f25016ecd0215e4da259c6))

### 2.8.3

October 11, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.8.3)

#### Bug Fixes

*   prevent registering device with empty identifier existing BQ tasks ([#392](https://github.com/customerio/customerio-ios/issues/392)) ([867619f](https://github.com/customerio/customerio-ios/commit/867619f4885e0c2e438b55826557c3fa5649b035))

### 2.8.2

September 7, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.8.2)

#### Bug Fixes

*   reduce memory and cpu usage while running background queue ([#379](https://github.com/customerio/customerio-ios/issues/379)) ([87a7eed](https://github.com/customerio/customerio-ios/commit/87a7eed5dc8e101a0d1c3f0b6e83d8b7d637cfcb))

### 2.8.1

August 31, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.8.1)

#### Bug Fixes

*   added url path encoding ([#376](https://github.com/customerio/customerio-ios/issues/376)) ([fbfa384](https://github.com/customerio/customerio-ios/commit/fbfa384428fdcf3ea69d623e9728a76c4d5d0416))

### 2.8.0

August 31, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.8.0)

#### Features

*   filter automatic screenview tracking events ([#367](https://github.com/customerio/customerio-ios/issues/367)) ([1a535f9](https://github.com/customerio/customerio-ios/commit/1a535f96761fbeb1a31a7d0820cab77ec4e12c5f))

### 2.7.8

August 14, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.7.8)

#### Bug Fixes

*   cache queue inventory for lower CPU usage while running queue ([#368](https://github.com/customerio/customerio-ios/issues/368)) ([fdcb24c](https://github.com/customerio/customerio-ios/commit/fdcb24c4f68ca027458036920b09961e819af644))

### 2.7.7

July 26, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.7.7)

#### Bug Fixes

*   support json array in attributes ([#358](https://github.com/customerio/customerio-ios/issues/358)) ([a634358](https://github.com/customerio/customerio-ios/commit/a63435833b57f2a1405d018f158c1e945bf6c73d))

### 2.7.6

July 21, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.7.6)

#### Bug Fixes

*   apps initializing sdk multiple times in short amount of time may make SDK ignore requests ([#360](https://github.com/customerio/customerio-ios/issues/360)) ([09829e0](https://github.com/customerio/customerio-ios/commit/09829e0c55b3637d82059087bf72b1f1d14b0e59))

### 2.7.5

July 20, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.7.5)

#### Bug Fixes

*   deinit cleanup repo bad memory access ([#356](https://github.com/customerio/customerio-ios/issues/356)) ([0483fb0](https://github.com/customerio/customerio-ios/commit/0483fb04e02228bfe1dd1ff88e9e51e688b477fd))

### 2.7.4

July 17, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.7.4)

#### Bug Fixes

*   save device token in SDK even if no profile identified ([#354](https://github.com/customerio/customerio-ios/issues/354)) ([a49f72c](https://github.com/customerio/customerio-ios/commit/a49f72ce94549d4e9d754891e3b6f6b309f46e8a))

### 2.7.3

July 17, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.7.3)

#### Bug Fixes

*   prevent api calls when identifier is empty ([#353](https://github.com/customerio/customerio-ios/issues/353)) ([10b5db7](https://github.com/customerio/customerio-ios/commit/10b5db739444074847fb6e58e6554411e0a5fa74))

### 2.7.2

July 12, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.7.2)

#### Bug Fixes

*   gist migration to CIO ([#338](https://github.com/customerio/customerio-ios/issues/338)) ([#351](https://github.com/customerio/customerio-ios/issues/351)) ([5520a7c](https://github.com/customerio/customerio-ios/commit/5520a7ceb4d35170b4bf2d2493ceb9576ea8d3cf))

### 2.7.1

July 4, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.7.1)

#### Bug Fixes

*   bad memory access crash ([#342](https://github.com/customerio/customerio-ios/issues/342)) ([b83e6bd](https://github.com/customerio/customerio-ios/commit/b83e6bda1a0746eab65bb3d07887c3fcbcb67712))

### 2.7.0

June 21, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.7.0)

#### Features

*   include FCM SDK as a dependency to make FCM push setup easier ([#333](https://github.com/customerio/customerio-ios/issues/333)) ([233fc22](https://github.com/customerio/customerio-ios/commit/233fc228f768fb9e1a98dffd2b5c9d49d34c9cc2))

### 2.6.1

May 26, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.6.1)

#### Bug Fixes

*   internal module Common clashing with other Common modules in customers app ([#328](https://github.com/customerio/customerio-ios/issues/328)) ([817dd56](https://github.com/customerio/customerio-ios/commit/817dd5692c412e91b1edbac9af64c0f4844a4cb4))

### 2.6.0

May 26, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.6.0)

#### Features

*   in-app dismiss message ([#320](https://github.com/customerio/customerio-ios/issues/320)) ([e067001](https://github.com/customerio/customerio-ios/commit/e067001628423a2dc4d9a5c1836a9d985cf60150))

### 2.5.3

May 26, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.5.3)

#### Bug Fixes

*   in-app universal link redirection support ([#329](https://github.com/customerio/customerio-ios/issues/329)) ([51470e8](https://github.com/customerio/customerio-ios/commit/51470e80270092da1948f04a388aedaf0f2fcf35))

### 2.5.2

May 19, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.5.2)

#### Bug Fixes

*   exact version for gist ([#321](https://github.com/customerio/customerio-ios/issues/321)) ([4b75cc5](https://github.com/customerio/customerio-ios/commit/4b75cc53e8f15a5496df17e825e12b4f44c3efef))

### 2.5.1

May 12, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.5.1)

#### Bug Fixes

*   sdk wrappers not having device token registered because of application lifecycle ([#285](https://github.com/customerio/customerio-ios/issues/285)) ([da7fc51](https://github.com/customerio/customerio-ios/commit/da7fc512e9308af208de8dea5aeaf95839a52fc1))

### 2.5.0

April 27, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.5.0)

#### Features

*   expose current SDK config options for reference ([#298](https://github.com/customerio/customerio-ios/issues/298)) ([6ac739b](https://github.com/customerio/customerio-ios/commit/6ac739b1550636db10230d8b2c10783f46626250))

### 2.4.1

April 27, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.4.1)

#### Bug Fixes

*   auto update gist in CocoaPods ([#303](https://github.com/customerio/customerio-ios/issues/303)) ([6096d17](https://github.com/customerio/customerio-ios/commit/6096d176cdc52e7e8a949960bfb9c4aa1541c8fd))

### 2.4.0

April 27, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.4.0)

#### Features

*   get the version of the SDK ([#299](https://github.com/customerio/customerio-ios/issues/299)) ([38a6b00](https://github.com/customerio/customerio-ios/commit/38a6b0061f0f5b317f592ec885f8746c65ab8ba5))

### 2.3.0

April 19, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.3.0)

#### Features

*   in app click tracking ([#284](https://github.com/customerio/customerio-ios/issues/284)) ([4ed8edb](https://github.com/customerio/customerio-ios/commit/4ed8edbd0f9e7a7aa6a708e525c6081e93658e98))

### 2.2.0

April 18, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.2.0)

#### Features

*   ui for new sample app with apns ([#282](https://github.com/customerio/customerio-ios/issues/282)) ([06e4a6b](https://github.com/customerio/customerio-ios/commit/06e4a6b71554610c7e7d3b95f62d129d934414be))

### 2.1.2

March 10, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.1.2)

#### Bug Fixes

*   delete tasks that returns http 400 ([#276](https://github.com/customerio/customerio-ios/issues/276)) ([aabfe9e](https://github.com/customerio/customerio-ios/commit/aabfe9ec02ec5b40326c60e973cdfa5f9338f85f))

### 2.1.1

March 8, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.1.1)

#### Bug Fixes

*   cocoapods app extension targets able to compile ([#277](https://github.com/customerio/customerio-ios/issues/277)) ([8dbca8f](https://github.com/customerio/customerio-ios/commit/8dbca8fab912913b5b26652098d5c1958dbdb4fd))

### 2.1.0

February 22, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.1.0)

#### Features

*   add in-app event listener ([#211](https://github.com/customerio/customerio-ios/issues/211)) ([737d43b](https://github.com/customerio/customerio-ios/commit/737d43b262cb467d6fb0dfc160d558ce3de09bf7))
*   in-app feature no longer requires orgId ([#252](https://github.com/customerio/customerio-ios/issues/252)) ([acd12da](https://github.com/customerio/customerio-ios/commit/acd12dab64e119546379f52552f2434843252682))

#### Bug Fixes

*   access modifier for metric ([#263](https://github.com/customerio/customerio-ios/issues/263)) ([e641982](https://github.com/customerio/customerio-ios/commit/e641982c86e5e4347977f0c0af2615d4541ff0e5))
*   added reusable code for wrapper SDKs ([#247](https://github.com/customerio/customerio-ios/issues/247)) ([36adf15](https://github.com/customerio/customerio-ios/commit/36adf158748b7dc439812807fd4d27a287a82e1a))
*   in-app missing event ([#259](https://github.com/customerio/customerio-ios/issues/259)) ([43b3e97](https://github.com/customerio/customerio-ios/commit/43b3e9706b152fe2dead882336a3f416ba400b73))
*   modify in-app event listener action parameters to new name ([#255](https://github.com/customerio/customerio-ios/issues/255)) ([b46528a](https://github.com/customerio/customerio-ios/commit/b46528a0cd6cda4f8428eef0001032a79338e1cf))
*   region visibility modifier to be used by wrappers ([#260](https://github.com/customerio/customerio-ios/issues/260)) ([f0edfbc](https://github.com/customerio/customerio-ios/commit/f0edfbc52a4694b2cee29a431d8c0943f819815b))
*   update the gist version in podspec ([#256](https://github.com/customerio/customerio-ios/issues/256)) ([5451488](https://github.com/customerio/customerio-ios/commit/545148820187c04938e717fce4e166cd77a78f92))

### 2.1.0-beta.2

February 9, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.1.0-beta.2)

#### Bug Fixes

*   access modifier for metric ([#263](https://github.com/customerio/customerio-ios/issues/263)) ([e641982](https://github.com/customerio/customerio-ios/commit/e641982c86e5e4347977f0c0af2615d4541ff0e5))

### 2.1.0-beta.1

February 7, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.1.0-beta.1)

#### Features

*   add in-app event listener ([#211](https://github.com/customerio/customerio-ios/issues/211)) ([737d43b](https://github.com/customerio/customerio-ios/commit/737d43b262cb467d6fb0dfc160d558ce3de09bf7))
*   in-app feature no longer requires orgId ([#252](https://github.com/customerio/customerio-ios/issues/252)) ([acd12da](https://github.com/customerio/customerio-ios/commit/acd12dab64e119546379f52552f2434843252682))

#### Bug Fixes

*   added reusable code for wrapper SDKs ([#247](https://github.com/customerio/customerio-ios/issues/247)) ([36adf15](https://github.com/customerio/customerio-ios/commit/36adf158748b7dc439812807fd4d27a287a82e1a))
*   in-app missing event ([#259](https://github.com/customerio/customerio-ios/issues/259)) ([43b3e97](https://github.com/customerio/customerio-ios/commit/43b3e9706b152fe2dead882336a3f416ba400b73))
*   modify in-app event listener action parameters to new name ([#255](https://github.com/customerio/customerio-ios/issues/255)) ([b46528a](https://github.com/customerio/customerio-ios/commit/b46528a0cd6cda4f8428eef0001032a79338e1cf))
*   region visibility modifier to be used by wrappers ([#260](https://github.com/customerio/customerio-ios/issues/260)) ([f0edfbc](https://github.com/customerio/customerio-ios/commit/f0edfbc52a4694b2cee29a431d8c0943f819815b))
*   update the gist version in podspec ([#256](https://github.com/customerio/customerio-ios/issues/256)) ([5451488](https://github.com/customerio/customerio-ios/commit/545148820187c04938e717fce4e166cd77a78f92))

### 2.0.6

February 15, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.0.6)

#### Bug Fixes

*   universal links deep links open host app ([#268](https://github.com/customerio/customerio-ios/issues/268)) ([29c95b5](https://github.com/customerio/customerio-ios/commit/29c95b5b9810f6cdec22a15df643f8d1a9fb7d58))

### 2.0.5

February 10, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.0.5)

#### Bug Fixes

*   universal links when touch a push notification open host app ([#265](https://github.com/customerio/customerio-ios/issues/265)) ([7dcaf73](https://github.com/customerio/customerio-ios/commit/7dcaf736912e23cbc6dced0206c4a4f53c6e298d))

### 2.0.4

January 17, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.0.4)

#### Bug Fixes

*   async running BQ operations in loop ([#250](https://github.com/customerio/customerio-ios/issues/250)) ([f0a3d9c](https://github.com/customerio/customerio-ios/commit/f0a3d9cf6c85d6efa619d748db16f4e04b596e9f))

### 2.0.3

January 11, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.0.3)

#### Bug Fixes

*   revert 2.0.2 as it was found unstable ([#249](https://github.com/customerio/customerio-ios/issues/249)) ([51b5831](https://github.com/customerio/customerio-ios/commit/51b58314705eaa336e2eeb3579b3ca7df0cfcaab))

### 2.0.2

January 6, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.0.2)

**It's recommended to avoid installing this version of the iOS SDK as issues have been reported with it.** Until a newer release is out, it's recommended to use 2.0.1

#### Bug Fixes

*   prevent stackoverflow while executing background queue with lots of tasks in it ([#245](https://github.com/customerio/customerio-ios/issues/245)) ([ef0c428](https://github.com/customerio/customerio-ios/commit/ef0c4285bbe1a908e9695258f84cde26b62eeb80))

### 2.0.1

December 22, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.0.1)

#### Bug Fixes

*   download rich push images from CDN ([#237](https://github.com/customerio/customerio-ios/issues/237)) ([b30cf02](https://github.com/customerio/customerio-ios/commit/b30cf02f2a27a210fe07e8bea61dc618c5c57b2d))

### 2.0.0

December 13, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.0.0)

#### ⚠ BREAKING CHANGES

*   make delivered push metric more reliable ([0478e52](https://github.com/customerio/customerio-ios/commit/0478e5273017867ecff194905d130cbf32d588ac))
*   remove FCM dependency from cocoapods (#210)
*   singleton API only way to use SDK now (#209)
*   SDK should not modify custom attributes casing ([#234](https://github.com/customerio/customerio-ios/issues/234)) ([8160fdf](https://github.com/customerio/customerio-ios/commit/8160fdfb07f29a3e450cb8a5481b3ca75622cdce))

#### Bug Fixes

*   add sdkwrapperconfig to rich push SDK config ([#226](https://github.com/customerio/customerio-ios/issues/226)) ([e43b4cf](https://github.com/customerio/customerio-ios/commit/e43b4cfe30c38e118b1c622675bab48c41072d30))
*   fix compile time errors notification service extensions ([#214](https://github.com/customerio/customerio-ios/issues/214)) ([bd5911b](https://github.com/customerio/customerio-ios/commit/bd5911b1401e26112a900c6a0c6f132c3ab2c27a))
*   sdk not able to compile in ios app ([#225](https://github.com/customerio/customerio-ios/issues/225)) ([e4d1b3f](https://github.com/customerio/customerio-ios/commit/e4d1b3f2b4bda91862151947e480b0644d5cc704))
*   make delivered push metric more reliable ([0478e52](https://github.com/customerio/customerio-ios/commit/0478e5273017867ecff194905d130cbf32d588ac))
*   SDK should not modify custom attributes casing ([#234](https://github.com/customerio/customerio-ios/issues/234)) ([8160fdf](https://github.com/customerio/customerio-ios/commit/8160fdfb07f29a3e450cb8a5481b3ca75622cdce))

#### Code Refactoring

*   remove FCM dependency from cocoapods ([#210](https://github.com/customerio/customerio-ios/issues/210)) ([3547076](https://github.com/customerio/customerio-ios/commit/3547076a3694c211f1b11b2a61db7d6debe05a6b))
*   singleton API only way to use SDK now ([#209](https://github.com/customerio/customerio-ios/issues/209)) ([72b7477](https://github.com/customerio/customerio-ios/commit/72b7477b16c490b9839fd48f51487e657440a75c))

### 2.0.0-beta.1

December 9, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.0.0-beta.1)

#### ⚠ BREAKING CHANGES

Read our [migration guide](https://customer.io/docs/sdk/ios/beta/migrate-upgrade/) to safely update from v1 to v2

*   make delivered push metric more reliable
*   remove FCM dependency from cocoapods (#210)
*   singleton API only way to use SDK now (#209)

#### Bug Fixes

*   add sdkwrapperconfig to rich push SDK config ([#226](https://github.com/customerio/customerio-ios/issues/226)) ([e43b4cf](https://github.com/customerio/customerio-ios/commit/e43b4cfe30c38e118b1c622675bab48c41072d30))
*   do not modify custom attributes casing ([#234](https://github.com/customerio/customerio-ios/issues/234)) ([8160fdf](https://github.com/customerio/customerio-ios/commit/8160fdfb07f29a3e450cb8a5481b3ca75622cdce))
*   fix compile time errors notification service extensions ([#214](https://github.com/customerio/customerio-ios/issues/214)) ([bd5911b](https://github.com/customerio/customerio-ios/commit/bd5911b1401e26112a900c6a0c6f132c3ab2c27a))
*   make delivered push metric more reliable ([0478e52](https://github.com/customerio/customerio-ios/commit/0478e5273017867ecff194905d130cbf32d588ac))
*   sdk not able to compile in ios app ([#225](https://github.com/customerio/customerio-ios/issues/225)) ([e4d1b3f](https://github.com/customerio/customerio-ios/commit/e4d1b3f2b4bda91862151947e480b0644d5cc704))

#### Code Refactoring

*   remove FCM dependency from cocoapods ([#210](https://github.com/customerio/customerio-ios/issues/210)) ([3547076](https://github.com/customerio/customerio-ios/commit/3547076a3694c211f1b11b2a61db7d6debe05a6b))
*   singleton API only way to use SDK now ([#209](https://github.com/customerio/customerio-ios/issues/209)) ([72b7477](https://github.com/customerio/customerio-ios/commit/72b7477b16c490b9839fd48f51487e657440a75c))

### 2.0.0-alpha.2

December 2, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.0.0-alpha.2)

#### Bug Fixes

*   sdk not able to compile in ios app ([#225](https://github.com/customerio/customerio-ios/issues/225)) ([e4d1b3f](https://github.com/customerio/customerio-ios/commit/e4d1b3f2b4bda91862151947e480b0644d5cc704))

### 2.0.0-alpha.1

November 30, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/2.0.0-alpha.1)

#### ⚠ BREAKING CHANGES

*   make delivered push metric more reliable
*   remove FCM dependency from cocoapods (#210)
*   singleton API only way to use SDK now (#209)

#### Bug Fixes

*   fix compile time errors notification service extensions ([#214](https://github.com/customerio/customerio-ios/issues/214)) ([bd5911b](https://github.com/customerio/customerio-ios/commit/bd5911b1401e26112a900c6a0c6f132c3ab2c27a))
*   make delivered push metric more reliable ([0478e52](https://github.com/customerio/customerio-ios/commit/0478e5273017867ecff194905d130cbf32d588ac))

#### Code Refactoring

*   remove FCM dependency from cocoapods ([#210](https://github.com/customerio/customerio-ios/issues/210)) ([3547076](https://github.com/customerio/customerio-ios/commit/3547076a3694c211f1b11b2a61db7d6debe05a6b))
*   singleton API only way to use SDK now ([#209](https://github.com/customerio/customerio-ios/issues/209)) ([72b7477](https://github.com/customerio/customerio-ios/commit/72b7477b16c490b9839fd48f51487e657440a75c))

## 1.x Releases

* * *

### 1.2.9

January 6, 2023 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.2.9)

#### Bug Fixes

*   1.2.8 initialize in-app with debug logs no longer crashes SDK ([#243](https://github.com/customerio/customerio-ios/issues/243)) ([98962f7](https://github.com/customerio/customerio-ios/commit/98962f76ef70536c68ebccc809e9eaab86931aae))

### 1.2.8

December 22, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.2.8)

#### Bug Fixes

*   snake\_case bug fix via configuration ([#238](https://github.com/customerio/customerio-ios/issues/238)) ([b1f3729](https://github.com/customerio/customerio-ios/commit/b1f37296871419a269a45d56bea3d2cd9ec39aac))

### 1.2.7

December 6, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.2.7)

#### Bug Fixes

*   push images and processing simple push ([#230](https://github.com/customerio/customerio-ios/issues/230)) ([f109f04](https://github.com/customerio/customerio-ios/commit/f109f04d04e2b87ef75707a15818050c7c84b45a))

### 1.2.6

November 17, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.2.6)

#### Bug Fixes

*   device attributes shows sdk version instead of wrapper version ([e2462b9](https://github.com/customerio/customerio-ios/commit/e2462b9408fdaba2b690e3d1209aa17680457d92))

### 1.2.5

November 14, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.2.5)

#### Bug Fixes

*   fix compile time errors notification service extensions ([#216](https://github.com/customerio/customerio-ios/issues/216)) ([6e8484a](https://github.com/customerio/customerio-ios/commit/6e8484af6fc72c0e77cfd3d60bbb3fe808d067a8))

### 1.2.4

November 11, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.2.4)

#### Bug Fixes

*   updated gist version in podspec ([ab231b1](https://github.com/customerio/customerio-ios/commit/ab231b169208fb869fb1083869ee4c0cb854728b))

### 1.2.3

November 10, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.2.3)

#### Bug Fixes

*   install in-app bug fix via gist 2.2.1 ([38d64fd](https://github.com/customerio/customerio-ios/commit/38d64fd69ce5947a097c5cb3d249d40f74149ff0))

### 1.2.2

October 31, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.2.2)

#### Bug Fixes

*   updating gist dependency version ([0b8569c](https://github.com/customerio/customerio-ios/commit/0b8569ce0d11feb35e62be30d2788077f94f6016))

### 1.2.1

October 25, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.2.1)

#### Bug Fixes

*   added expo and flutter values in source enum ([274aa1c](https://github.com/customerio/customerio-ios/commit/274aa1ca6911636e285a8a3a509a891434d16614))

### 1.2.0

October 17, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.2.0)

#### Features

*   allow option to handle deep link yourself ([#177](https://github.com/customerio/customerio-ios/issues/177)) ([b8167ea](https://github.com/customerio/customerio-ios/commit/b8167ea6c34f5f863b597ee7e365377ff5c33dea))
*   delete expired queue tasks ([dc22280](https://github.com/customerio/customerio-ios/commit/dc22280afd3c7a9e721e7e1105954f9656cbc7ea))
*   in-app into develop to promote to alpha ([2b2712c](https://github.com/customerio/customerio-ios/commit/2b2712c09be4baf7dabd27af5af00d8a5e2d859d))
*   sdk wrappers modify user-agent ([5c127e5](https://github.com/customerio/customerio-ios/commit/5c127e5f32a16e568f4fd969094223130de42e36))

#### Bug Fixes

*   cocoapods compiling of SDK ([a20e583](https://github.com/customerio/customerio-ios/commit/a20e58342bf5175cd42934cb778cedd1402dcb0f))
*   compile sdk without xcode error app extensions ([#185](https://github.com/customerio/customerio-ios/issues/185)) ([5fc0fd5](https://github.com/customerio/customerio-ios/commit/5fc0fd5809ac6be4002605bb28a7649b664272f1))
*   consolidate all apple platforms under ios ([423f050](https://github.com/customerio/customerio-ios/commit/423f05037fcfbfc7035e8317a52865b64601f8b4))
*   deprecating creating own instances ([#202](https://github.com/customerio/customerio-ios/issues/202)) ([18859e6](https://github.com/customerio/customerio-ios/commit/18859e6c4b78365610b92f61eb12b3923c858941))
*   image not shown in rich push notification ([9fb8490](https://github.com/customerio/customerio-ios/commit/9fb8490ae7bc068dd8ab11348b5cf1290da5b79e))
*   improve reliability of screen view tracking ([60e9289](https://github.com/customerio/customerio-ios/commit/60e9289930485d3394911490bf6f05c7d1af521c))
*   make sdkwrapperconfig accessible ([#188](https://github.com/customerio/customerio-ios/issues/188)) ([f996a68](https://github.com/customerio/customerio-ios/commit/f996a682dd1eedfc4f37bbd82644541423f4b8d6))
*   queue attempts to run all tasks on each run ([80f90e9](https://github.com/customerio/customerio-ios/commit/80f90e97e9f9c76e7d235b2065c799c396414236))
*   restricting create own instance ([085735c](https://github.com/customerio/customerio-ios/commit/085735ca08eb21b012f586ea6008d7e732a4e66f))
*   some classes not found in tracking module ([45f178e](https://github.com/customerio/customerio-ios/commit/45f178ecd670514864194611506d652a5e8cd4b9))
*   updating gist dependency version ([23c432e](https://github.com/customerio/customerio-ios/commit/23c432e520176aca1b1bdd39d25dffa8d4b7aa90))

### 1.2.0-beta.4

October 13, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.2.0-beta.4)

#### Bug Fixes

*   restricting create own instance ([085735c](https://github.com/customerio/customerio-ios/commit/085735ca08eb21b012f586ea6008d7e732a4e66f))

### 1.2.0-beta.3

October 7, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.2.0-beta.3)

#### Bug Fixes

*   deprecating creating own instances ([#202](https://github.com/customerio/customerio-ios/issues/202)) ([18859e6](https://github.com/customerio/customerio-ios/commit/18859e6c4b78365610b92f61eb12b3923c858941))

### 1.2.0-beta.2

October 4, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.2.0-beta.2)

#### Bug Fixes

*   updating gist dependency version ([23c432e](https://github.com/customerio/customerio-ios/commit/23c432e520176aca1b1bdd39d25dffa8d4b7aa90))

### 1.2.0-beta.1

September 8, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.2.0-beta.1)

#### Features

*   allow option to handle deep link yourself ([#177](https://github.com/customerio/customerio-ios/issues/177)) ([b8167ea](https://github.com/customerio/customerio-ios/commit/b8167ea6c34f5f863b597ee7e365377ff5c33dea))
*   delete expired queue tasks ([dc22280](https://github.com/customerio/customerio-ios/commit/dc22280afd3c7a9e721e7e1105954f9656cbc7ea))
*   in-app into develop to promote to alpha ([2b2712c](https://github.com/customerio/customerio-ios/commit/2b2712c09be4baf7dabd27af5af00d8a5e2d859d))
*   sdk wrappers modify user-agent ([5c127e5](https://github.com/customerio/customerio-ios/commit/5c127e5f32a16e568f4fd969094223130de42e36))

#### Bug Fixes

*   cocoapods compiling of SDK ([a20e583](https://github.com/customerio/customerio-ios/commit/a20e58342bf5175cd42934cb778cedd1402dcb0f))
*   compile sdk without xcode error app extensions ([#185](https://github.com/customerio/customerio-ios/issues/185)) ([5fc0fd5](https://github.com/customerio/customerio-ios/commit/5fc0fd5809ac6be4002605bb28a7649b664272f1))
*   consolidate all apple platforms under ios ([423f050](https://github.com/customerio/customerio-ios/commit/423f05037fcfbfc7035e8317a52865b64601f8b4))
*   image not shown in rich push notification ([9fb8490](https://github.com/customerio/customerio-ios/commit/9fb8490ae7bc068dd8ab11348b5cf1290da5b79e))
*   improve reliability of screen view tracking ([60e9289](https://github.com/customerio/customerio-ios/commit/60e9289930485d3394911490bf6f05c7d1af521c))
*   make sdkwrapperconfig accessible ([#188](https://github.com/customerio/customerio-ios/issues/188)) ([f996a68](https://github.com/customerio/customerio-ios/commit/f996a682dd1eedfc4f37bbd82644541423f4b8d6))
*   queue attempts to run all tasks on each run ([80f90e9](https://github.com/customerio/customerio-ios/commit/80f90e97e9f9c76e7d235b2065c799c396414236))
*   some classes not found in tracking module ([45f178e](https://github.com/customerio/customerio-ios/commit/45f178ecd670514864194611506d652a5e8cd4b9))

### 1.2.0-alpha.4

September 1, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.2.0-alpha.4)

#### Bug Fixes

*   consolidate all apple platforms under ios ([423f050](https://github.com/customerio/customerio-ios/commit/423f05037fcfbfc7035e8317a52865b64601f8b4))
*   image not shown in rich push notification ([9fb8490](https://github.com/customerio/customerio-ios/commit/9fb8490ae7bc068dd8ab11348b5cf1290da5b79e))

### 1.2.0-alpha.3

August 5, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.2.0-alpha.3)

#### Features

*   in-app into develop to promote to alpha ([2b2712c](https://github.com/customerio/customerio-ios/commit/2b2712c09be4baf7dabd27af5af00d8a5e2d859d))

#### Bug Fixes

*   make sdkwrapperconfig accessible ([#188](https://github.com/customerio/customerio-ios/issues/188)) ([f996a68](https://github.com/customerio/customerio-ios/commit/f996a682dd1eedfc4f37bbd82644541423f4b8d6))

### 1.2.0-alpha.2

July 26, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.2.0-alpha.2)

#### Features

*   allow option to handle deep link yourself ([#177](https://github.com/customerio/customerio-ios/issues/177)) ([b8167ea](https://github.com/customerio/customerio-ios/commit/b8167ea6c34f5f863b597ee7e365377ff5c33dea))

#### Bug Fixes

*   cocoapods compiling of SDK ([a20e583](https://github.com/customerio/customerio-ios/commit/a20e58342bf5175cd42934cb778cedd1402dcb0f))
*   compile sdk without xcode error app extensions ([#185](https://github.com/customerio/customerio-ios/issues/185)) ([5fc0fd5](https://github.com/customerio/customerio-ios/commit/5fc0fd5809ac6be4002605bb28a7649b664272f1))

### 1.2.0-alpha.1

July 25, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.2.0-alpha.1)

#### Features

*   delete expired queue tasks ([dc22280](https://github.com/customerio/customerio-ios/commit/dc22280afd3c7a9e721e7e1105954f9656cbc7ea))
*   sdk wrappers modify user-agent ([5c127e5](https://github.com/customerio/customerio-ios/commit/5c127e5f32a16e568f4fd969094223130de42e36))

#### Bug Fixes

*   improve reliability of screen view tracking ([60e9289](https://github.com/customerio/customerio-ios/commit/60e9289930485d3394911490bf6f05c7d1af521c))
*   queue attempts to run all tasks on each run ([80f90e9](https://github.com/customerio/customerio-ios/commit/80f90e97e9f9c76e7d235b2065c799c396414236))
*   some classes not found in tracking module ([45f178e](https://github.com/customerio/customerio-ios/commit/45f178ecd670514864194611506d652a5e8cd4b9))

### 1.1.1

June 10, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.1.1)

#### Bug Fixes

*   send attributes in all caps to API ([9eea27b](https://github.com/customerio/customerio-ios/commit/9eea27b29e11b2fed75bfe584f0a98f923e393fc))

### 1.1.0

June 1, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.1.0)

#### Features

*   add device\_manufacturer device attribute ([585aefb](https://github.com/customerio/customerio-ios/commit/585aefbad99a06ac54c8358ffac89d3a5beba857))
*   adding support for device attributes and custom device attributes ([#143](https://github.com/customerio/customerio-ios/issues/143)) ([84ead00](https://github.com/customerio/customerio-ios/commit/84ead00911416b39a25a2318c6e9a084bde22c75))

#### Bug Fixes

*   add siteid to logs help with multi-workspace ([#130](https://github.com/customerio/customerio-ios/issues/130)) ([0ad3906](https://github.com/customerio/customerio-ios/commit/0ad39061e5add7f69e9617056a99669b00814df9))
*   change property name from push\_subscribed to push\_enabled ([2f071ec](https://github.com/customerio/customerio-ios/commit/2f071ec2d48465731cfbb17c051d8f16a5cbb10c))
*   locale uses preferred language ([4a5ecf1](https://github.com/customerio/customerio-ios/commit/4a5ecf149cf43d5b0df3b0f01ef24063c1f3a6c8))
*   missing public sdk functions ([0ca0618](https://github.com/customerio/customerio-ios/commit/0ca06183f9c0094019e3e58d0963b5931909c348))
*   remove platform from os\_version attribute ([f735197](https://github.com/customerio/customerio-ios/commit/f7351973d1a0edf47952133fa6b62bfe06a3e5a1))
*   use dashes instead of underscores device locale ([f85e858](https://github.com/customerio/customerio-ios/commit/f85e858d673fa24da324e0feecb4678c241c907e))

### 1.1.0-beta.1

April 19, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.1.0-beta.1)

#### Features

*   add device\_manufacturer device attribute ([585aefb](https://github.com/customerio/customerio-ios/commit/585aefbad99a06ac54c8358ffac89d3a5beba857))
*   adding support for device attributes and custom device attributes ([#143](https://github.com/customerio/customerio-ios/issues/143)) ([84ead00](https://github.com/customerio/customerio-ios/commit/84ead00911416b39a25a2318c6e9a084bde22c75))

#### Bug Fixes

*   add siteid to logs help with multi-workspace ([#130](https://github.com/customerio/customerio-ios/issues/130)) ([0ad3906](https://github.com/customerio/customerio-ios/commit/0ad39061e5add7f69e9617056a99669b00814df9))
*   change property name from push\_subscribed to push\_enabled ([2f071ec](https://github.com/customerio/customerio-ios/commit/2f071ec2d48465731cfbb17c051d8f16a5cbb10c))
*   locale uses preferred language ([4a5ecf1](https://github.com/customerio/customerio-ios/commit/4a5ecf149cf43d5b0df3b0f01ef24063c1f3a6c8))
*   missing public sdk functions ([0ca0618](https://github.com/customerio/customerio-ios/commit/0ca06183f9c0094019e3e58d0963b5931909c348))
*   remove platform from os\_version attribute ([f735197](https://github.com/customerio/customerio-ios/commit/f7351973d1a0edf47952133fa6b62bfe06a3e5a1))
*   use dashes instead of underscores device locale ([f85e858](https://github.com/customerio/customerio-ios/commit/f85e858d673fa24da324e0feecb4678c241c907e))

### 1.1.0-alpha.3

April 19, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.1.0-alpha.3)

#### Features

*   add device\_manufacturer device attribute ([585aefb](https://github.com/customerio/customerio-ios/commit/585aefbad99a06ac54c8358ffac89d3a5beba857))

#### Bug Fixes

*   locale uses preferred language ([4a5ecf1](https://github.com/customerio/customerio-ios/commit/4a5ecf149cf43d5b0df3b0f01ef24063c1f3a6c8))

### 1.1.0-alpha.2

March 25, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.1.0-alpha.2)

#### Bug Fixes

*   remove platform from os\_version attribute ([f735197](https://github.com/customerio/customerio-ios/commit/f7351973d1a0edf47952133fa6b62bfe06a3e5a1))
*   use dashes instead of underscores device locale ([f85e858](https://github.com/customerio/customerio-ios/commit/f85e858d673fa24da324e0feecb4678c241c907e))

### 1.1.0-alpha.1

March 22, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.1.0-alpha.1)

#### Features

*   adding support for device attributes and custom device attributes ([#143](https://github.com/customerio/customerio-ios/issues/143)) ([84ead00](https://github.com/customerio/customerio-ios/commit/84ead00911416b39a25a2318c6e9a084bde22c75))

#### Bug Fixes

*   add siteid to logs help with multi-workspace ([#130](https://github.com/customerio/customerio-ios/issues/130)) ([0ad3906](https://github.com/customerio/customerio-ios/commit/0ad39061e5add7f69e9617056a99669b00814df9))
*   change property name from push\_subscribed to push\_enabled ([2f071ec](https://github.com/customerio/customerio-ios/commit/2f071ec2d48465731cfbb17c051d8f16a5cbb10c))
*   missing public sdk functions ([0ca0618](https://github.com/customerio/customerio-ios/commit/0ca06183f9c0094019e3e58d0963b5931909c348))

### 1.0.3

March 15, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.3)

#### Bug Fixes

*   delete device token from profile on logout ([#145](https://github.com/customerio/customerio-ios/issues/145)) ([d976c27](https://github.com/customerio/customerio-ios/commit/d976c27b3200f124260c3d006f825613cb308b12))

### 1.0.2

February 7, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.2)

#### Bug Fixes

*   create valid JSON request body when sending nil as track events data ([#140](https://github.com/customerio/customerio-ios/issues/140)) ([c5d1a50](https://github.com/customerio/customerio-ios/commit/c5d1a50b46422257d4cd770ff052d5d9e6daee38))

### 1.0.1

February 2, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.1)

#### Bug Fixes

*   data:null as HTTP request body ([#135](https://github.com/customerio/customerio-ios/issues/135)) ([04c5211](https://github.com/customerio/customerio-ios/commit/04c5211ac83592e7191d7313a61e37cea8be38fa))

### 1.0.0

January 19, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0)

#### Bug Fixes

*   add createdAt timestamp to added queue tasks ([#106](https://github.com/customerio/customerio-ios/issues/106)) ([46aab62](https://github.com/customerio/customerio-ios/commit/46aab6212093ef374df7952f5c335e166a26498e))
*   automatic screenview tracking correct siteid ([#120](https://github.com/customerio/customerio-ios/issues/120)) ([abd3ea9](https://github.com/customerio/customerio-ios/commit/abd3ea9fdf3b68bd85aa88e4e89d972182c1a3d9))
*   background queue timer scheduling and running ([#114](https://github.com/customerio/customerio-ios/issues/114)) ([6be8a74](https://github.com/customerio/customerio-ios/commit/6be8a7404c5bee1d201138b20dc1abd017254546))
*   call callback on main thread APN tokens ([#40](https://github.com/customerio/customerio-ios/issues/40)) ([982ce9d](https://github.com/customerio/customerio-ios/commit/982ce9d9a8277d72d3fa49c66537a0a6f5b6401a))
*   change hostname for CIO API ([#109](https://github.com/customerio/customerio-ios/issues/109)) ([90e9407](https://github.com/customerio/customerio-ios/commit/90e9407ceb0c1f6f59c7ad7c835ac556651f55ef))
*   convert APN device token to string ([#39](https://github.com/customerio/customerio-ios/issues/39)) ([1f64a13](https://github.com/customerio/customerio-ios/commit/1f64a13467966f077642745d9f60a168113bdbff))
*   deep links previously being ignored ([#79](https://github.com/customerio/customerio-ios/issues/79)) ([2041767](https://github.com/customerio/customerio-ios/commit/204176735a8641a77d58232af1daa4e290ee0ca4))
*   duplicate entries for active workspace ([#124](https://github.com/customerio/customerio-ios/issues/124)) ([c903e4a](https://github.com/customerio/customerio-ios/commit/c903e4a972bc8d1ea7ecbbd013b4fd5dfef6ddc2))
*   improve user-agent with more detail ([#74](https://github.com/customerio/customerio-ios/issues/74)) ([4301034](https://github.com/customerio/customerio-ios/commit/43010347680d84dfa7d2b782bce18a25b40b8296))
*   logs now show up in mac console app ([#80](https://github.com/customerio/customerio-ios/issues/80)) ([535d0be](https://github.com/customerio/customerio-ios/commit/535d0be1bdbd3a43d9ba1fe2fabeb4002ea5d35f))
*   more safely handle 5xx, 401 status codes ([#107](https://github.com/customerio/customerio-ios/issues/107)) ([d56807b](https://github.com/customerio/customerio-ios/commit/d56807bdbda95e11d742916db4b19e545bead6d7))
*   mutex locks shared across instances ([#119](https://github.com/customerio/customerio-ios/issues/119)) ([cb169bf](https://github.com/customerio/customerio-ios/commit/cb169bf71acd5c0fff9b971894465800b4a7bfbc))
*   opened push metrics ([#70](https://github.com/customerio/customerio-ios/issues/70)) ([a277378](https://github.com/customerio/customerio-ios/commit/a2773782811b581d17cc2eb554c321d91c8b6b67))
*   opened push metrics being sent to API again ([#111](https://github.com/customerio/customerio-ios/issues/111)) ([93971bf](https://github.com/customerio/customerio-ios/commit/93971bf8e8bf272fbcc73d327069ce0cd244066d))
*   remove apn device token profile request body ([#41](https://github.com/customerio/customerio-ios/issues/41)) ([61946c4](https://github.com/customerio/customerio-ios/commit/61946c4dea617561891188aa537277cc67af35ae))
*   remove custom jsonencoder public functions ([#122](https://github.com/customerio/customerio-ios/issues/122)) ([061a568](https://github.com/customerio/customerio-ios/commit/061a5684a170bd231d5583d56b32406f0086a456))
*   rename singletons instance to shared ([#34](https://github.com/customerio/customerio-ios/issues/34)) ([3bf1384](https://github.com/customerio/customerio-ios/commit/3bf1384ce9b2d4a8551bb353c1b0e6ce195378df))
*   rename stop identify function ([#31](https://github.com/customerio/customerio-ios/issues/31)) ([d97e931](https://github.com/customerio/customerio-ios/commit/d97e931fa7a001e7a58658471244dcfc1494a386))
*   screen view tracking ([#108](https://github.com/customerio/customerio-ios/issues/108)) ([f836b9a](https://github.com/customerio/customerio-ios/commit/f836b9aaa59cd525afc4db935db4b378f71fa8f4))
*   track events type in HTTP requests ([#117](https://github.com/customerio/customerio-ios/issues/117)) ([745d4ad](https://github.com/customerio/customerio-ios/commit/745d4ad642be84f27688b45e2608db1c44cf2798))

#### Features

*   add \[String:Any\] support to identify & track ([#94](https://github.com/customerio/customerio-ios/issues/94)) ([5a220c4](https://github.com/customerio/customerio-ios/commit/5a220c401c1df1153cdb0cb56efe5a885dd08c68))
*   add screen view tracking ([#82](https://github.com/customerio/customerio-ios/issues/82)) ([c2034a6](https://github.com/customerio/customerio-ios/commit/c2034a6fcbcea15716529a4091538f5bb8dc6a00))
*   automatic push events ([#63](https://github.com/customerio/customerio-ios/issues/63)) ([cf81b23](https://github.com/customerio/customerio-ios/commit/cf81b2381993d7108ee7b860d4221c929a98d5d7))
*   create background queue ([#99](https://github.com/customerio/customerio-ios/issues/99)) ([80fffb8](https://github.com/customerio/customerio-ios/commit/80fffb881f69337125b189fbf4de5c47bd6c22f2))
*   create mocks for push messaging ([#35](https://github.com/customerio/customerio-ios/issues/35)) ([b2c5d62](https://github.com/customerio/customerio-ios/commit/b2c5d6221434e9c559bf818790c48d31decf7f77))
*   event tracking ([#42](https://github.com/customerio/customerio-ios/issues/42)) ([be768bb](https://github.com/customerio/customerio-ios/commit/be768bbb32680ac0ca8dce098f62720394965f85))
*   identify customer ([#27](https://github.com/customerio/customerio-ios/issues/27)) ([f79d1c9](https://github.com/customerio/customerio-ios/commit/f79d1c9737f215beef4b69167db31ac0d51a16dd))
*   make US default region ([#28](https://github.com/customerio/customerio-ios/issues/28)) ([1d10a8f](https://github.com/customerio/customerio-ios/commit/1d10a8ffc773bf82f0b20abde09fbb95b01797e5))
*   register device token with FCM ([#46](https://github.com/customerio/customerio-ios/issues/46)) ([f6a87e0](https://github.com/customerio/customerio-ios/commit/f6a87e0e889b9fdac2c8093a8f4fb4f5f0e9ea2a))
*   register/delete device tokens ([#26](https://github.com/customerio/customerio-ios/issues/26)) ([d0ddc07](https://github.com/customerio/customerio-ios/commit/d0ddc07c6b2c25e1168be47e61821e78f5c158a5))
*   rich push deep links ([#45](https://github.com/customerio/customerio-ios/issues/45)) ([fe21cc8](https://github.com/customerio/customerio-ios/commit/fe21cc87e7146c01df96fbda858e7bd69a6851cb))
*   rich push images ([#59](https://github.com/customerio/customerio-ios/issues/59)) ([03fc284](https://github.com/customerio/customerio-ios/commit/03fc284f09bb79db53dbc42d78c39acd1204843e))
*   save all siteids registered with SDK ([#30](https://github.com/customerio/customerio-ios/issues/30)) ([95db6dc](https://github.com/customerio/customerio-ios/commit/95db6dc9462a892f8c46d083be85a97dde1e0b76))
*   subsequent identifies without passing identifier ([#96](https://github.com/customerio/customerio-ios/issues/96)) ([47d9166](https://github.com/customerio/customerio-ios/commit/47d916634a5ab34842a19074f3b3c110de4e0348))
*   track push events ([#47](https://github.com/customerio/customerio-ios/issues/47)) ([a37e60e](https://github.com/customerio/customerio-ios/commit/a37e60ef390e8cb9c4693c08ae21221186fe8dd2))

### 1.0.0-beta.3

January 19, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-beta.3)

#### Bug Fixes

*   duplicate entries for active workspace ([#124](https://github.com/customerio/customerio-ios/issues/124)) ([c903e4a](https://github.com/customerio/customerio-ios/commit/c903e4a972bc8d1ea7ecbbd013b4fd5dfef6ddc2))

### 1.0.0-beta.2

January 19, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-beta.2)

#### Bug Fixes

*   add createdAt timestamp to added queue tasks ([#106](https://github.com/customerio/customerio-ios/issues/106)) ([46aab62](https://github.com/customerio/customerio-ios/commit/46aab6212093ef374df7952f5c335e166a26498e))
*   automatic screenview tracking correct siteid ([#120](https://github.com/customerio/customerio-ios/issues/120)) ([abd3ea9](https://github.com/customerio/customerio-ios/commit/abd3ea9fdf3b68bd85aa88e4e89d972182c1a3d9))
*   background queue timer scheduling and running ([#114](https://github.com/customerio/customerio-ios/issues/114)) ([6be8a74](https://github.com/customerio/customerio-ios/commit/6be8a7404c5bee1d201138b20dc1abd017254546))
*   change hostname for CIO API ([#109](https://github.com/customerio/customerio-ios/issues/109)) ([90e9407](https://github.com/customerio/customerio-ios/commit/90e9407ceb0c1f6f59c7ad7c835ac556651f55ef))
*   more safely handle 5xx, 401 status codes ([#107](https://github.com/customerio/customerio-ios/issues/107)) ([d56807b](https://github.com/customerio/customerio-ios/commit/d56807bdbda95e11d742916db4b19e545bead6d7))
*   mutex locks shared across instances ([#119](https://github.com/customerio/customerio-ios/issues/119)) ([cb169bf](https://github.com/customerio/customerio-ios/commit/cb169bf71acd5c0fff9b971894465800b4a7bfbc))
*   opened push metrics being sent to API again ([#111](https://github.com/customerio/customerio-ios/issues/111)) ([93971bf](https://github.com/customerio/customerio-ios/commit/93971bf8e8bf272fbcc73d327069ce0cd244066d))
*   remove custom jsonencoder public functions ([#122](https://github.com/customerio/customerio-ios/issues/122)) ([061a568](https://github.com/customerio/customerio-ios/commit/061a5684a170bd231d5583d56b32406f0086a456))
*   screen view tracking ([#108](https://github.com/customerio/customerio-ios/issues/108)) ([f836b9a](https://github.com/customerio/customerio-ios/commit/f836b9aaa59cd525afc4db935db4b378f71fa8f4))
*   track events type in HTTP requests ([#117](https://github.com/customerio/customerio-ios/issues/117)) ([745d4ad](https://github.com/customerio/customerio-ios/commit/745d4ad642be84f27688b45e2608db1c44cf2798))

#### Features

*   add \[String:Any\] support to identify & track ([#94](https://github.com/customerio/customerio-ios/issues/94)) ([5a220c4](https://github.com/customerio/customerio-ios/commit/5a220c401c1df1153cdb0cb56efe5a885dd08c68))
*   add screen view tracking ([#82](https://github.com/customerio/customerio-ios/issues/82)) ([c2034a6](https://github.com/customerio/customerio-ios/commit/c2034a6fcbcea15716529a4091538f5bb8dc6a00))
*   create background queue ([#99](https://github.com/customerio/customerio-ios/issues/99)) ([80fffb8](https://github.com/customerio/customerio-ios/commit/80fffb881f69337125b189fbf4de5c47bd6c22f2))
*   subsequent identifies without passing identifier ([#96](https://github.com/customerio/customerio-ios/issues/96)) ([47d9166](https://github.com/customerio/customerio-ios/commit/47d916634a5ab34842a19074f3b3c110de4e0348))

### 1.0.0-alpha.33

January 19, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.33)

#### Bug Fixes

*   more safely handle 5xx, 401 status codes ([#107](https://github.com/customerio/customerio-ios/issues/107)) ([d56807b](https://github.com/customerio/customerio-ios/commit/d56807bdbda95e11d742916db4b19e545bead6d7))

### 1.0.0-alpha.32

January 19, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.32)

#### Bug Fixes

*   automatic screenview tracking correct siteid ([#120](https://github.com/customerio/customerio-ios/issues/120)) ([abd3ea9](https://github.com/customerio/customerio-ios/commit/abd3ea9fdf3b68bd85aa88e4e89d972182c1a3d9))

### 1.0.0-alpha.31

January 19, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.31)

#### Bug Fixes

*   background queue timer scheduling and running ([#114](https://github.com/customerio/customerio-ios/issues/114)) ([6be8a74](https://github.com/customerio/customerio-ios/commit/6be8a7404c5bee1d201138b20dc1abd017254546))

### 1.0.0-alpha.30

January 18, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.30)

#### Bug Fixes

*   remove custom jsonencoder public functions ([#122](https://github.com/customerio/customerio-ios/issues/122)) ([061a568](https://github.com/customerio/customerio-ios/commit/061a5684a170bd231d5583d56b32406f0086a456))

### 1.0.0-alpha.29

January 18, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.29)

#### Bug Fixes

*   mutex locks shared across instances ([#119](https://github.com/customerio/customerio-ios/issues/119)) ([cb169bf](https://github.com/customerio/customerio-ios/commit/cb169bf71acd5c0fff9b971894465800b4a7bfbc))

### 1.0.0-alpha.28

January 14, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.28)

#### Bug Fixes

*   track events type in HTTP requests ([#117](https://github.com/customerio/customerio-ios/issues/117)) ([745d4ad](https://github.com/customerio/customerio-ios/commit/745d4ad642be84f27688b45e2608db1c44cf2798))

### 1.0.0-alpha.27

January 14, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.27)

#### Bug Fixes

*   screen view tracking ([#108](https://github.com/customerio/customerio-ios/issues/108)) ([f836b9a](https://github.com/customerio/customerio-ios/commit/f836b9aaa59cd525afc4db935db4b378f71fa8f4))

### 1.0.0-alpha.26

January 13, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.26)

#### Bug Fixes

*   opened push metrics being sent to API again ([#111](https://github.com/customerio/customerio-ios/issues/111)) ([93971bf](https://github.com/customerio/customerio-ios/commit/93971bf8e8bf272fbcc73d327069ce0cd244066d))

### 1.0.0-alpha.25

January 11, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.25)

#### Bug Fixes

*   change hostname for CIO API ([#109](https://github.com/customerio/customerio-ios/issues/109)) ([90e9407](https://github.com/customerio/customerio-ios/commit/90e9407ceb0c1f6f59c7ad7c835ac556651f55ef))

### 1.0.0-alpha.24

January 10, 2022 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.24)

#### Bug Fixes

*   add createdAt timestamp to added queue tasks ([#106](https://github.com/customerio/customerio-ios/issues/106)) ([46aab62](https://github.com/customerio/customerio-ios/commit/46aab6212093ef374df7952f5c335e166a26498e))

### 1.0.0-alpha.23

December 17, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.23)

#### Features

*   create background queue ([#99](https://github.com/customerio/customerio-ios/issues/99)) ([80fffb8](https://github.com/customerio/customerio-ios/commit/80fffb881f69337125b189fbf4de5c47bd6c22f2))

### 1.0.0-alpha.22

December 16, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.22)

#### Features

*   subsequent identifies without passing identifier ([#96](https://github.com/customerio/customerio-ios/issues/96)) ([47d9166](https://github.com/customerio/customerio-ios/commit/47d916634a5ab34842a19074f3b3c110de4e0348))

### 1.0.0-beta.1

December 15, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-beta.1)

#### Bug Fixes

*   call callback on main thread APN tokens ([#40](https://github.com/customerio/customerio-ios/issues/40)) ([982ce9d](https://github.com/customerio/customerio-ios/commit/982ce9d9a8277d72d3fa49c66537a0a6f5b6401a))
*   convert APN device token to string ([#39](https://github.com/customerio/customerio-ios/issues/39)) ([1f64a13](https://github.com/customerio/customerio-ios/commit/1f64a13467966f077642745d9f60a168113bdbff))
*   deep links previously being ignored ([#79](https://github.com/customerio/customerio-ios/issues/79)) ([2041767](https://github.com/customerio/customerio-ios/commit/204176735a8641a77d58232af1daa4e290ee0ca4))
*   improve user-agent with more detail ([#74](https://github.com/customerio/customerio-ios/issues/74)) ([4301034](https://github.com/customerio/customerio-ios/commit/43010347680d84dfa7d2b782bce18a25b40b8296))
*   logs now show up in mac console app ([#80](https://github.com/customerio/customerio-ios/issues/80)) ([535d0be](https://github.com/customerio/customerio-ios/commit/535d0be1bdbd3a43d9ba1fe2fabeb4002ea5d35f))
*   opened push metrics ([#70](https://github.com/customerio/customerio-ios/issues/70)) ([a277378](https://github.com/customerio/customerio-ios/commit/a2773782811b581d17cc2eb554c321d91c8b6b67))
*   remove apn device token profile request body ([#41](https://github.com/customerio/customerio-ios/issues/41)) ([61946c4](https://github.com/customerio/customerio-ios/commit/61946c4dea617561891188aa537277cc67af35ae))
*   rename singletons instance to shared ([#34](https://github.com/customerio/customerio-ios/issues/34)) ([3bf1384](https://github.com/customerio/customerio-ios/commit/3bf1384ce9b2d4a8551bb353c1b0e6ce195378df))
*   rename stop identify function ([#31](https://github.com/customerio/customerio-ios/issues/31)) ([d97e931](https://github.com/customerio/customerio-ios/commit/d97e931fa7a001e7a58658471244dcfc1494a386))

#### Features

*   automatic push events ([#63](https://github.com/customerio/customerio-ios/issues/63)) ([cf81b23](https://github.com/customerio/customerio-ios/commit/cf81b2381993d7108ee7b860d4221c929a98d5d7))
*   create mocks for push messaging ([#35](https://github.com/customerio/customerio-ios/issues/35)) ([b2c5d62](https://github.com/customerio/customerio-ios/commit/b2c5d6221434e9c559bf818790c48d31decf7f77))
*   event tracking ([#42](https://github.com/customerio/customerio-ios/issues/42)) ([be768bb](https://github.com/customerio/customerio-ios/commit/be768bbb32680ac0ca8dce098f62720394965f85))
*   identify customer ([#27](https://github.com/customerio/customerio-ios/issues/27)) ([f79d1c9](https://github.com/customerio/customerio-ios/commit/f79d1c9737f215beef4b69167db31ac0d51a16dd))
*   make US default region ([#28](https://github.com/customerio/customerio-ios/issues/28)) ([1d10a8f](https://github.com/customerio/customerio-ios/commit/1d10a8ffc773bf82f0b20abde09fbb95b01797e5))
*   register device token with FCM ([#46](https://github.com/customerio/customerio-ios/issues/46)) ([f6a87e0](https://github.com/customerio/customerio-ios/commit/f6a87e0e889b9fdac2c8093a8f4fb4f5f0e9ea2a))
*   register/delete device tokens ([#26](https://github.com/customerio/customerio-ios/issues/26)) ([d0ddc07](https://github.com/customerio/customerio-ios/commit/d0ddc07c6b2c25e1168be47e61821e78f5c158a5))
*   rich push deep links ([#45](https://github.com/customerio/customerio-ios/issues/45)) ([fe21cc8](https://github.com/customerio/customerio-ios/commit/fe21cc87e7146c01df96fbda858e7bd69a6851cb))
*   rich push images ([#59](https://github.com/customerio/customerio-ios/issues/59)) ([03fc284](https://github.com/customerio/customerio-ios/commit/03fc284f09bb79db53dbc42d78c39acd1204843e))
*   save all siteids registered with SDK ([#30](https://github.com/customerio/customerio-ios/issues/30)) ([95db6dc](https://github.com/customerio/customerio-ios/commit/95db6dc9462a892f8c46d083be85a97dde1e0b76))
*   track push events ([#47](https://github.com/customerio/customerio-ios/issues/47)) ([a37e60e](https://github.com/customerio/customerio-ios/commit/a37e60ef390e8cb9c4693c08ae21221186fe8dd2))

### 1.0.0-alpha.21

December 13, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.21)

#### Features

*   add \[String:Any\] support to identify & track ([#94](https://github.com/customerio/customerio-ios/issues/94)) ([5a220c4](https://github.com/customerio/customerio-ios/commit/5a220c401c1df1153cdb0cb56efe5a885dd08c68))

### 1.0.0-alpha.20

December 13, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.20)

#### Features

*   add screen view tracking ([#82](https://github.com/customerio/customerio-ios/issues/82)) ([c2034a6](https://github.com/customerio/customerio-ios/commit/c2034a6fcbcea15716529a4091538f5bb8dc6a00))

### 1.0.0-alpha.19

December 3, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.19)

#### Bug Fixes

*   logs now show up in mac console app ([#80](https://github.com/customerio/customerio-ios/issues/80)) ([535d0be](https://github.com/customerio/customerio-ios/commit/535d0be1bdbd3a43d9ba1fe2fabeb4002ea5d35f))

### 1.0.0-alpha.18

November 18, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.18)

#### Bug Fixes

*   deep links previously being ignored ([#79](https://github.com/customerio/customerio-ios/issues/79)) ([2041767](https://github.com/customerio/customerio-ios/commit/204176735a8641a77d58232af1daa4e290ee0ca4))

### 1.0.0-alpha.17

November 3, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.17)

#### Bug Fixes

*   improve user-agent with more detail ([#74](https://github.com/customerio/customerio-ios/issues/74)) ([4301034](https://github.com/customerio/customerio-ios/commit/43010347680d84dfa7d2b782bce18a25b40b8296))

### 1.0.0-alpha.16

October 8, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.16)

#### Bug Fixes

*   opened push metrics ([#70](https://github.com/customerio/customerio-ios/issues/70)) ([a277378](https://github.com/customerio/customerio-ios/commit/a2773782811b581d17cc2eb554c321d91c8b6b67))

### 1.0.0-alpha.15

September 25, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.15)

#### Features

*   automatic push events ([#63](https://github.com/customerio/customerio-ios/issues/63)) ([cf81b23](https://github.com/customerio/customerio-ios/commit/cf81b2381993d7108ee7b860d4221c929a98d5d7))

### 1.0.0-alpha.14

September 24, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.14)

#### Features

*   rich push images ([#59](https://github.com/customerio/customerio-ios/issues/59)) ([03fc284](https://github.com/customerio/customerio-ios/commit/03fc284f09bb79db53dbc42d78c39acd1204843e))

### 1.0.0-alpha.13

September 23, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.13)

#### Features

*   rich push deep links ([#45](https://github.com/customerio/customerio-ios/issues/45)) ([fe21cc8](https://github.com/customerio/customerio-ios/commit/fe21cc87e7146c01df96fbda858e7bd69a6851cb))
*   track push events ([#47](https://github.com/customerio/customerio-ios/issues/47)) ([a37e60e](https://github.com/customerio/customerio-ios/commit/a37e60ef390e8cb9c4693c08ae21221186fe8dd2))

### 1.0.0-alpha.12

September 21, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.12)

#### Features

*   register device token with FCM ([#46](https://github.com/customerio/customerio-ios/issues/46)) ([f6a87e0](https://github.com/customerio/customerio-ios/commit/f6a87e0e889b9fdac2c8093a8f4fb4f5f0e9ea2a))

### 1.0.0-alpha.11

September 20, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.11)

#### Features

*   event tracking ([#42](https://github.com/customerio/customerio-ios/issues/42)) ([be768bb](https://github.com/customerio/customerio-ios/commit/be768bbb32680ac0ca8dce098f62720394965f85))

### 1.0.0-alpha.10

September 15, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.10)

#### Bug Fixes

*   remove apn device token profile request body ([#41](https://github.com/customerio/customerio-ios/issues/41)) ([61946c4](https://github.com/customerio/customerio-ios/commit/61946c4dea617561891188aa537277cc67af35ae))

### 1.0.0-alpha.9

September 15, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.9)

#### Bug Fixes

*   call callback on main thread APN tokens ([#40](https://github.com/customerio/customerio-ios/issues/40)) ([982ce9d](https://github.com/customerio/customerio-ios/commit/982ce9d9a8277d72d3fa49c66537a0a6f5b6401a))

### 1.0.0-alpha.8

September 15, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.8)

#### Bug Fixes

*   convert APN device token to string ([#39](https://github.com/customerio/customerio-ios/issues/39)) ([1f64a13](https://github.com/customerio/customerio-ios/commit/1f64a13467966f077642745d9f60a168113bdbff))

### 1.0.0-alpha.7

September 13, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.7)

#### Features

*   create mocks for push messaging ([#35](https://github.com/customerio/customerio-ios/issues/35)) ([b2c5d62](https://github.com/customerio/customerio-ios/commit/b2c5d6221434e9c559bf818790c48d31decf7f77))

### 1.0.0-alpha.6

September 13, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.6)

#### Bug Fixes

*   rename singletons instance to shared ([#34](https://github.com/customerio/customerio-ios/issues/34)) ([3bf1384](https://github.com/customerio/customerio-ios/commit/3bf1384ce9b2d4a8551bb353c1b0e6ce195378df))

### 1.0.0-alpha.5

September 10, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.5)

#### Features

*   register/delete device tokens ([#26](https://github.com/customerio/customerio-ios/issues/26)) ([d0ddc07](https://github.com/customerio/customerio-ios/commit/d0ddc07c6b2c25e1168be47e61821e78f5c158a5))

### 1.0.0-alpha.4

September 10, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.4)

#### Bug Fixes

*   rename stop identify function ([#31](https://github.com/customerio/customerio-ios/issues/31)) ([d97e931](https://github.com/customerio/customerio-ios/commit/d97e931fa7a001e7a58658471244dcfc1494a386))

### 1.0.0-alpha.3

September 10, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.3)

#### Features

*   save all siteids registered with SDK ([#30](https://github.com/customerio/customerio-ios/issues/30)) ([95db6dc](https://github.com/customerio/customerio-ios/commit/95db6dc9462a892f8c46d083be85a97dde1e0b76))

### 1.0.0-alpha.2

September 9, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.2)

#### Features

*   make US default region ([#28](https://github.com/customerio/customerio-ios/issues/28)) ([1d10a8f](https://github.com/customerio/customerio-ios/commit/1d10a8ffc773bf82f0b20abde09fbb95b01797e5))

### 1.0.0-alpha.1

September 9, 2021 · [View on GitHub](https://github.com/customerio/customerio-ios/releases/tag/1.0.0-alpha.1)

#### Features

*   identify customer ([#27](https://github.com/customerio/customerio-ios/issues/27)) ([f79d1c9](https://github.com/customerio/customerio-ios/commit/f79d1c9737f215beef4b69167db31ac0d51a16dd))

---

## Whats new > Fid migration

**Source:** /integrations/sdk/ios/whats-new/fid-migration

# 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) ↗](https://firebase.google.com/docs/cloud-messaging/manage-tokens) 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](/messaging/channels/push/developer-guide/#device-ids).

## Turn on FID mode

1.  Update the Customer.io iOS SDK to 4.11.0 or later, `CioFirebaseWrapper` to 1.1.0 or later, and `FirebaseMessaging` to 12.19.0 or later.
    
2.  Turn on Firebase’s FID setting in your app’s `Info.plist`. See [Firebase’s Apple setup guide ↗](https://firebase.google.com/docs/cloud-messaging/ios/client) for details.
    
    ```
    <key>FirebaseMessagingInstallationIdEnabled</key>
    <true/>
    ```
    
3.  If you set `autoFetchDeviceToken(false)` and forward Firebase’s `MessagingDelegate` callbacks to Customer.io yourself, forward `messaging(_:didReceiveRegistration:)` instead of `messaging(_:didReceiveRegistrationToken:)`. Firebase calls only `didReceiveRegistration` in FID mode.
    
    ```
    func messaging(_ messaging: Messaging, didReceiveRegistration installationId: String?) {
        MessagingPush.shared.messaging(messaging, didReceiveRegistration: installationId)
    }
    ```
    
4.  If your app calls `MessagingPush.shared.registerDeviceToken(fcmToken:)`, pass the FID from `Installations.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.

---

## Whats new > Ios 27 uiscene migration

**Source:** /integrations/sdk/ios/whats-new/ios-27-uiscene-migration

# iOS 27 UIScene migration guide

Keep Customer.io working when your app adopts UIScene or builds with Xcode 27, covering native iOS, Flutter, React Native, and Expo.

This guide explains how to keep Customer.io working when your iOS app adopts `UIScene` or is built with the iOS 27 SDK. It covers **native iOS, Flutter, React Native, and Expo**. Customer.io’s scene integrations are released, but the React Native and Expo paths also depend on framework releases. The relevant availability is listed below. Scene support is additive: Customer.io does not replace your app’s root lifecycle.

Apple beta software

[Xcode 27 ↗](https://developer.apple.com/documentation/xcode-release-notes/xcode-27-release-notes) and iOS 27 are currently beta releases. Recheck Apple’s current release notes before shipping with the iOS 27 SDK.

## Who needs to migrate

The scene launch requirement applies only when **both** of these are true:

*   Your app is built with the iOS 27 SDK, **and**
*   it runs on iOS 27 or later.

A binary built with an earlier SDK keeps launching normally when a user upgrades to iOS 27, so you don’t have to change anything to keep existing installs working.

UIKit can get your scene configuration from either a nonempty `UIApplicationSceneManifest` or your AppDelegate’s `application(_:configurationForConnecting:options:)` method. Your app needs migration when neither source provides a valid scene configuration. If one of those sources already provides the configuration, your app has adopted the scene lifecycle.

**Existing AppDelegate-only integrations require no Customer.io change** while your toolchain still permits that lifecycle. The scene steps in this guide are additive. Adopt them when you adopt `UIScene` or move to the iOS 27 SDK.

Jump to your platform: [native iOS](#native-ios) · [Flutter](#flutter) · [React Native](#react-native) · [Expo](#expo).

## Customer.io and framework versions

Use these versions for the scene path:

Integration

Baseline for this guide

Native iOS

Use the current `customerio-ios` 4.7.6 release. It uses existing public APIs and does not require a separate scene-specific release.

Flutter

`customer_io` 4.4.0 or newer and Flutter 3.44.8 or newer for a scene host. Flutter’s scene APIs start in 3.38 and become the default in 3.41; 3.44.8 is the supported Customer.io scene floor and also contains a separate Xcode 27 build-tool fix.

React Native

`customerio-reactnative` 6.10.0 or newer with React Native 0.88 or newer for acknowledged scene routing. Version 6.9.0 remains compatible through the earlier `Linking` path. React Native 0.87 and earlier don’t expose the scene URL APIs that the bridge requires. Keep the AppDelegate path until React Native 0.88 is stable.

Expo

`customerio-expo-plugin` 3.9.0 and its required `customerio-reactnative` 6.9.0 peer with Expo SDK 58 or newer. Expo SDK 58 is currently pre-release; stable Expo SDK 57 apps keep the AppDelegate path.

## Shared AppDelegate and UIScene ownership

The division of responsibility is the same on every platform:

*   **You keep application-level setup in your AppDelegate.** A host that adopts `UIScene` continues to initialize Customer.io, register APNs tokens, and configure notification handling at the application level. That doesn’t move to a scene.
*   **Your host or framework owns the scene layer:** the scene manifest, the SceneDelegate, the root window, and the final navigation.
*   **Customer.io reports attribution and offers the destination:** through the configured native callback (native iOS) or the wrapper/bridge your framework provides (Flutter, React Native, Expo). Without a host handoff, the native SDK may fall back to opening the destination through the system.
*   **Customer.io does not add its own SceneDelegate** and does not choose which of your windows owns a URL. Scene support is additive; it never replaces your app’s root lifecycle.

Each platform section below shows the exact handoff for that framework.

## Native iOS

Native iOS uses public APIs in the current `customerio-ios` 4.7.6 release, so it does not need a separate scene-specific release. This section assumes you’ve already set up [push notifications](/integrations/sdk/ios/push/push-setup/) and, if you use them, [Live Activities](/integrations/sdk/ios/live-activities/set-up/). Your existing APNs, FCM, and multiple-provider setups are unchanged by scene adoption.

### No change needed (AppDelegate-only apps)

If your app uses an app-delegate lifecycle, with no `UIApplicationSceneManifest` and no `application(_:configurationForConnecting:options:)`, keep your current integration. Nothing on this page is required while your toolchain still permits that lifecycle.

### Keep initialization in your AppDelegate

A scene-adopting app still initializes Customer.io, registers APNs tokens, and configures `UNUserNotificationCenter` at the application level. Leave `CustomerIO.initialize`, `MessagingPushAPN.initialize` (or `MessagingPushFCM.initialize`), and your notification-center handling in your AppDelegate. Customer.io does not add a SceneDelegate and does not choose which of your windows opens a URL. Your app owns the scene manifest, the SceneDelegate, the root window, and the final navigation.

### Route Customer.io destinations with a deep-link callback

Under `UIScene`, iOS delivers universal links to `scene(_:continue:)` instead of your AppDelegate. The SDK’s own fallback still calls `application(_:continue:restorationHandler:)` directly for `http` and `https` destinations, but it cannot deliver a URL to your SceneDelegate. Configure the callback below to keep scene-based routing under your control.

If your app uses Customer.io deep-link destinations and wants in-app routing, configure `SDKConfigBuilder.deepLinkCallback` where you initialize the SDK. Return `true` when your app takes ownership of the URL. Return `false` to let the SDK try the legacy AppDelegate continuation callback and then open the URL through the system if the AppDelegate doesn’t handle it. Make the ownership decision synchronously and dispatch UI work to the main thread when your router requires it. Apps with no Customer.io destinations, or that intentionally accept the fallback behavior, don’t need a callback.

```
let config = SDKConfigBuilder(cdpApiKey: cdpApiKey)
    .autoTrackDeviceAttributes(true)
    .autoTrackUIKitScreenViews()
    .migrationSiteId(siteId)
    .deepLinkCallback { url in
        guard canHandleDeepLink(url) else { return false }

        DispatchQueue.main.async {
            handleDeepLink(url)
        }
        return true
    }

CustomerIO.initialize(withConfig: config.build())
```

### Handle URLs and universal links in your SceneDelegate

The system delivers URLs to the scene. Handle cold launches in `scene(_:willConnectTo:options:)` and warm opens in `scene(_:openURLContexts:)` (app-scheme URLs) and `scene(_:continue:)` (universal links). Handle app-scheme URLs (URL contexts) and universal links (user activities) independently.

```
import UIKit

class SceneDelegate: UIResponder, UIWindowSceneDelegate {
    var window: UIWindow?

    func scene(_ scene: UIScene, willConnectTo session: UISceneSession,
               options connectionOptions: UIScene.ConnectionOptions) {
        guard let windowScene = (scene as? UIWindowScene) else { return }
        window = UIWindow(windowScene: windowScene)
        // Set up your root view controller, then window?.makeKeyAndVisible().

        handle(urlContexts: connectionOptions.urlContexts)      // cold app-scheme URLs
        handle(userActivities: connectionOptions.userActivities) // cold universal links
    }

    func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
        handle(urlContexts: URLContexts)                         // warm app-scheme URLs
    }

    func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
        handle(userActivities: [userActivity])                  // warm universal links
    }

    private func handle(urlContexts: Set<UIOpenURLContext>) {
        for context in urlContexts {
            // Route context.url into your app's navigation.
        }
    }

    private func handle(userActivities: Set<NSUserActivity>) {
        for activity in userActivities {
            guard let url = activity.webpageURL else { continue }
            // Route the universal link into your app's navigation.
        }
    }
}
```

### Optional: Live Activities

This step applies only if you installed the separate [Live Activities](/integrations/sdk/ios/live-activities/set-up/) package. Pass each opened URL through `CustomerIO.liveActivities.handleWidgetUrl(_:)` exactly once before you route the returned destination. On a cold launch, call it from `scene(_:willConnectTo:options:)`. On a warm open, call it from `scene(_:openURLContexts:)`. A `nil` result means the activity had no destination; an ordinary URL is returned unchanged.

Add the Live Activities imports at the top of your `SceneDelegate` file:

```
import CioDataPipelines
import CioLiveActivities
```

Then replace the placeholder `handle(urlContexts:)` method inside `SceneDelegate` with this implementation:

```
private func handle(urlContexts: Set<UIOpenURLContext>) {
    for context in urlContexts {
        guard let destination = CustomerIO.liveActivities.handleWidgetUrl(context.url) else {
            continue
        }
        _ = handleDeepLink(destination)
    }
}
```

### Verify (native iOS)

Run through the [cold and warm verification checklist](#verification-checklist) and confirm the [single-scene support boundary](#single-scene-boundary) applies to your app. Detailed native steps live on the [deep links](/integrations/sdk/ios/push/deep-links/#uiscene-deep-links) and [Live Activities](/integrations/sdk/ios/live-activities/set-up/#uiscene-live-activities) pages.

## Flutter

This section covers the Flutter SDK (`customer_io`). If your app keeps the AppDelegate-only lifecycle, you don’t need to change anything for Customer.io. Follow the steps below only when your app adopts `UIScene` or you build with Xcode 27.

### When Flutter apps need to migrate

*   Flutter’s scene APIs are available from **Flutter 3.38** and become the default in **Flutter 3.41**.
*   Customer.io supports scene hosts on **Flutter 3.44.8 or newer**. This version also contains a separate Flutter build-tool fix required for **Xcode 27**.
*   Use **`customer_io` 4.4.0 or newer** on a scene-adopting app. AppDelegate-only apps keep the package’s published Flutter minimum.

### Let Flutter own the migration

Follow Flutter’s official [UIScene adoption guide ↗](https://docs.flutter.dev/release/breaking-changes/uiscenedelegate) for the framework migration. This page only describes the Customer.io-specific result of that migration.

After you migrate, your iOS host has:

*   **`CioAppDelegateWrapper` still as your application delegate.** Keep `@main class AppDelegateWithCioIntegration: CioAppDelegateWrapper<AppDelegate> {}`.
    
*   **The wrapped `AppDelegate` conforming to `FlutterImplicitEngineDelegate`**, with `GeneratedPluginRegistrant` registration moved out of `didFinishLaunchingWithOptions` and into `didInitializeImplicitFlutterEngine(_:)`:
    
    ```
    import UIKit
    import Flutter
    import CioMessagingPushFCM
    import CioFirebaseWrapper
    import FirebaseMessaging
    import FirebaseCore
    
    @main
    class AppDelegateWithCioIntegration: CioAppDelegateWrapper<AppDelegate> {}
    
    @objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
        // Register your Flutter plugins here instead of in didFinishLaunchingWithOptions.
        func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
            GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
        }
    
        override func application(
            _ application: UIApplication,
            didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
        ) -> Bool {
            // Customer.io init, APNs, and notification handling stay at the application level.
            // FirebaseApp.configure()
            MessagingPushFCM.initialize(
                withConfig: MessagingPushConfigBuilder().build()
            )
            UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate
    
            return super.application(application, didFinishLaunchingWithOptions: launchOptions)
        }
    
        override func application(_ application: UIApplication,
                                 didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
            super.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
            Messaging.messaging().apnsToken = deviceToken
        }
    }
    ```
    
*   **A standard `UIApplicationSceneManifest`.** Flutter only auto-migrates an unmodified template AppDelegate. A Customer.io integration customizes that file, so add the standard single-scene manifest manually:
    
    ```
    <key>UIApplicationSceneManifest</key>
    <dict>
        <key>UIApplicationSupportsMultipleScenes</key>
        <false/>
        <key>UISceneConfigurations</key>
        <dict>
            <key>UIWindowSceneSessionRoleApplication</key>
            <array>
                <dict>
                    <key>UISceneClassName</key>
                    <string>UIWindowScene</string>
                    <key>UISceneDelegateClassName</key>
                    <string>FlutterSceneDelegate</string>
                    <key>UISceneConfigurationName</key>
                    <string>flutter</string>
                    <key>UISceneStoryboardFile</key>
                    <string>Main</string>
                </dict>
            </array>
        </dict>
    </dict>
    ```
    
*   **`FlutterSceneDelegate` as your scene delegate.** The manifest above uses Flutter’s delegate directly, so you don’t need to create a `SceneDelegate` class.
    
    If you need a custom scene delegate, subclass `FlutterSceneDelegate`:
    
    ```
    import Flutter
    import UIKit
    
    class SceneDelegate: FlutterSceneDelegate {
    }
    ```
    
    Then change the manifest’s `UISceneDelegateClassName` to `$(PRODUCT_MODULE_NAME).SceneDelegate`. If you write a custom scene delegate that does **not** subclass `FlutterSceneDelegate`, it must conform to Flutter’s `FlutterSceneLifeCycleProvider` and forward every scene lifecycle callback to Flutter. Point `UISceneDelegateClassName` at your class in that case too.
    

### How Customer.io routing behaves under UIScene

*   **Push and in-app destinations route through Flutter automatically** when the standard scene manifest is present and Flutter deep linking is enabled (`FlutterDeepLinkingEnabled` is not set to `false`). The plugin installs its SDK deep-link callback during plugin registration, so a cold push tap that arrives before `CustomerIO.initialize` runs is still delivered to your Dart router.
*   **Ordinary links stay owned by Flutter.** Customer.io does not claim links it did not issue.
*   **Live Activity links** are unwrapped and attributed by Customer.io, which then offers the resulting destination to Flutter. In a scene host, `http`/`https` destinations from the SDK also reach the Dart router, so your **host router owns unknown-route and browser-opening policy**.
*   Live Activity **scene** attribution additionally requires the opt-in Live Activities module **and** a Flutter registrar that supports scene delegates (Flutter 3.44.8 or newer). Without the Live Activities module, push/in-app deep-link routing still works, but scene-delivered Live Activity taps are not attributed. See [Set up live notifications](/integrations/sdk/flutter/live-notifications/set-up/).

Warning

Don’t set the native `SDKConfigBuilder.deepLinkCallback` in a Flutter host. The Flutter plugin owns the SDK’s single callback slot and uses it to deliver Customer.io destinations to Dart.

### Advanced: `FlutterDeepLinkingEnabled = false`

If you set `FlutterDeepLinkingEnabled` to `false`, the plugin registers **neither** its scene adapter **nor** its SDK deep-link callback. Your host then owns **all** Customer.io destinations, including push taps, and must process Live Activity URLs before your own router handles them.

## React Native

These steps apply to hosts using `customerio-reactnative` **6.10.0 or newer** with **React Native 0.88 or newer**. Version 6.10.0 adds an acknowledged handler so JavaScript can accept or decline a Customer.io destination before the native SDK decides whether to fall back. If your app still uses the AppDelegate lifecycle, you don’t need any change here. Your existing integration keeps working.

React Native framework requirement

React Native 0.87 and earlier don’t expose the scene URL APIs that the Customer.io bridge requires. Keep the AppDelegate lifecycle and its existing deep-link integration until React Native 0.88 is available as a stable release. Installing `customerio-reactnative` 6.10.0 alone doesn’t add those framework APIs.

### Deep links (required for scene hosts)

A scene-adopting host owns its `SceneDelegate`. Four things are required, in order:

1.  **Install acknowledged deep-link routing before React Native starts.** Call this first in `scene(_:willConnectTo:options:)`, before you start the React Native factory:
    
    ```
    import customerio_reactnative
    
    NativeCustomerIO.configureAcknowledgedSceneDeepLinkRouting()
    ```
    
2.  **Pass cold connection options when React Native starts.** This preserves ordinary app-scheme URLs and universal links delivered when the app is terminated:
    
    ```
    reactNativeFactory?.startReactNative(
      withModuleName: "YourApp",
      in: window,
      connectionOptions: connectionOptions
    )
    ```
    
    If you use Customer.io Live Activities, use the `launchOptions` call in the next section instead. That helper attributes a Live Activity tap and preserves ordinary connection URLs for React Native.
    
3.  **Forward warm scene URLs and universal links to React Native.** These callbacks preserve your existing app links independently of Customer.io destinations:
    
    ```
    import React
    
    func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
      RCTLinkingManager.scene(scene, openURLContexts: URLContexts)
    }
    
    func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
      RCTLinkingManager.scene(scene, continue: userActivity)
    }
    ```
    
    If you use Customer.io Live Activities, replace the URL-context callback with the `handleAndRouteWidgetUrl` version in the next section. It passes ordinary URLs through to React Native as well.
    
4.  **Register the Customer.io deep-link handler when your router is ready.** You can register it before or after `CustomerIO.initialize`. Return `true` after your router accepts a destination. Return `false` to use the native fallback.
    
    ```
    import { useEffect } from 'react';
    import { CustomerIO, CioRegion } from 'customerio-reactnative';
    
    useEffect(() => {
      const subscription = CustomerIO.setDeepLinkHandler(async (url) => {
        if (!canRouteInApp(url)) {
          return false;
        }
    
        await routeInApp(url);
        return true;
      });
    
      CustomerIO.initialize({
        cdpApiKey: 'your-cdp-api-key',
        region: CioRegion.US,
      });
    
      return () => subscription.remove();
    }, []);
    ```
    

**How routing behaves in a scene host:**

*   Customer.io push, in-app, and inbox destinations are **buffered during cold launch** and then delivered after the acknowledged handler registers. They wait up to **ten seconds** for it.
*   The handler then has **ten seconds** to return a result. Returning `false`, throwing, rejecting, missing registration, or timing out makes the SDK try the host AppDelegate. It then sends an app-owned custom scheme to React Native `Linking`, or opens another URL through the system.
*   Keep a `Linking` listener when your handler might decline an app-owned custom scheme.
*   A handler that routes after the timeout can cause a second navigation because its late result can’t cancel a fallback that already ran.
*   The **JavaScript handler owns the routing decision**. Return `true` only after your app accepts the destination.

Backward-compatible Linking path

Version 6.9.0 scene integrations can keep `NativeCustomerIO.configureSceneDeepLinkRouting()` and a `Linking` listener registered before `CustomerIO.initialize`. That path still buffers cold URLs, but a `Linking` event can’t report whether JavaScript handled it. The SDK therefore can’t safely fall back after publishing the event. Prefer the acknowledged handler for new integrations.

### Live Activities in a scene host (optional)

Only applies if you installed the Live Activities module. In a `UIScene` host, handle both lifecycle paths.

**Cold scene connection:** pass launch options through the wrapper so a cold Live Activity tap is attributed and React Native receives the customer’s destination instead of Customer.io’s internal tracking URL:

```
import customerio_reactnative

reactNativeFactory?.startReactNative(
  withModuleName: "YourApp",
  in: window,
  launchOptions: NativeLiveActivities.reactNativeLaunchOptions(from: connectionOptions)
)
```

**Warm scene URL opens:** report the tap and route each remaining URL through React Native Linking:

```
import customerio_reactnative

func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
  for context in URLContexts {
    NativeLiveActivities.handleAndRouteWidgetUrl(context.url)
  }
}
```

Do **not** also pass those URLs to `RCTLinkingManager`. `handleAndRouteWidgetUrl` already sends them through the Customer.io scene bridge, and forwarding them again can deliver the same URL twice.

For an AppDelegate-only (legacy) host, keep the existing `NativeLiveActivities.handleWidgetUrl` example. See the [React Native live notifications setup](/integrations/sdk/react-native/live-notifications/set-up/).

### Unsupported: multiple simultaneous window scenes

This release’s compatibility scope is **one simultaneous window scene**. Multiple simultaneous React Native window scenes are outside this release. React Native’s URL notification is process-wide, so SDK-published destinations may reach every connected React Native instance rather than one selected window.

## Expo

The Customer.io Expo config plugin follows the lifecycle that Expo generates for your project. Expo owns the scene lifecycle, and the plugin configures the native Customer.io bridge to match it.

Expo framework requirement

Expo SDK 58 is currently pre-release. Stable Expo SDK 57 apps keep the AppDelegate path and don’t need a scene-related Customer.io change. Apply the scene instructions below after Expo SDK 58 is available as a stable release.

### When the scene path applies

The scene path applies when **all** of these are true:

*   Your app targets **Expo SDK 58 or newer**, which generates a `UIScene`\-based iOS project.
*   You use **`customerio-expo-plugin` 3.9.0 or newer** with its required **`customerio-reactnative` 6.9.0** peer.

Below Expo SDK 58, the plugin keeps the AppDelegate path and **no scene-related change is required**. Your existing setup keeps working while your toolchain still supports that lifecycle.

Note

Expo owns the scene manifest, `SceneDelegate`, root window, and final navigation. Customer.io reports attribution and hands your app the destination to route. Scene support is additive. Customer.io never replaces your app’s root lifecycle.

### Deep link readiness

The readiness step depends on how you initialize Customer.io:

*   **Native auto-initialization (`config` in `app.json`):** register your router first, then call `CustomerIO.setDeepLinkRoutingReady()`.
*   **JavaScript initialization:** register your router first, then call `CustomerIO.initialize(...)`. Initialization marks scene routing ready automatically, so don’t also call `setDeepLinkRoutingReady()`.

For native auto-initialization:

1.  Register your React Native `Linking` URL listener.
2.  Call `CustomerIO.setDeepLinkRoutingReady()`.

```
import { Linking } from 'react-native';
import { CustomerIO } from 'customerio-reactnative';

// Register your URL listener first...
Linking.addEventListener('url', ({ url }) => {
  // your app's navigation
});

// ...then signal that URL handling is ready.
CustomerIO.setDeepLinkRoutingReady();
```

*   **Apps without Expo Router** register their `Linking` listener first, then call `setDeepLinkRoutingReady()`.
*   **Expo Router apps** must **not** add a second navigating `Linking` listener. Expo Router already owns that subscription. Call `setDeepLinkRoutingReady()` once your router is ready.

Customer.io buffers cold-start notification destinations and delivers them to your `Linking` listener as `url` events **after** you signal readiness. They do **not** come back from `Linking.getInitialURL()`. If readiness isn’t signaled within ten seconds, Customer.io falls back to opening the destination through the system.

handleDeeplinkInKilledState is legacy

`handleDeeplinkInKilledState` is the legacy AppDelegate killed-state workaround for Expo SDK 53–57. It is **not** injected for the Expo SDK 58+ scene lifecycle, because scene routing replaces it. Setting it on a scene project has no effect.

### Live Activity links on the scene path

The scene path removes the AppDelegate Live Activity URL handling the plugin used to inject. Live Activity attribution therefore moves to JavaScript, so the `+native-intent.tsx` (or central `Linking`) step below is **required in the same upgrade** if you use Live Activities.

Process each incoming URL through `CustomerIO.liveActivities.handleWidgetUrl(path)` **exactly once**. The helper reports the opened event, then returns the destination to route. An ordinary URL passes through unchanged, and a Customer.io tracking URL with no destination returns `null`.

**Expo Router:** process Live Activity URLs in a top-level `app/+native-intent.tsx`:

```
import { CustomerIO } from 'customerio-reactnative';

export async function redirectSystemPath({ path }: { path: string }) {
  return CustomerIO.liveActivities.handleWidgetUrl(path);
}
```

If the helper returns `null`, Expo Router performs no redirect and keeps the current path.

**Apps without Expo Router:** apply the same helper exactly once in your central initial-URL and URL-subscription pipeline.

Warning

Don’t call `handleWidgetUrl` from both `+native-intent.tsx` and a `Linking` listener. Processing the same tracking URL twice reports two opened events.

## Cold and warm verification checklist

For each integration you use, verify:

*   The app launches from a terminated (cold) state.
*   A notification tap reaches the intended destination.
*   App-scheme links and universal links work in both **cold** and **warm** states.
*   Live Activity taps report attribution and route the destination **once** (if you use Live Activities).
*   Non-Customer.io notifications and any third-party routers still receive their callbacks.
*   Your existing APNs, FCM, and multiple-provider setups are unchanged by scene adoption. See the [iOS push setup](/integrations/sdk/ios/push/push-setup/) and [push certificates](/integrations/sdk/ios/push/push-certificates/) pages rather than re-configuring anything here.

An iOS 16 or newer Simulator on macOS 13 or newer can receive remote notifications from the APNs sandbox when its physical Mac has Apple silicon or an Apple T2 Security Chip. Use a physical device for production APNs or device-specific behavior. A simulator inside a virtualized macOS runner may not receive an APNs token.

## Single-scene support boundary

The supported compatibility scope is **one simultaneous window scene**. That covers the vast majority of iPhone and iPad apps.

Multiple simultaneous window scenes (multi-window ownership, for example, several windows of the same app open side by side on iPad or macOS) are **out of scope for this release** and aren’t yet supported by the SDK. Adopt the single-scene path described here; don’t rely on multi-window scene ownership.

## Troubleshooting

**A deep link opens in the browser (or the system) instead of your app.** The host handoff isn’t configured, so the SDK used its system-open fallback. Configure the platform’s callback: native iOS uses `SDKConfigBuilder.deepLinkCallback`; the framework platforms use their bridge/wrapper as described in each section.

**A notification tap does nothing on a cold launch.** Make sure your scene handler reads the launch URL/user activity from the connection options in `scene(_:willConnectTo:options:)` (or the framework equivalent), not only the warm-open callbacks.

**A Live Activity tap is attributed twice, or not at all.** Route each opened URL through the Live Activity handler exactly once before your own routing. Don’t also forward the same URL to a second handler.

**Universal links don’t reach your app after migration.** Universal-link ownership moves to the scene callback (`scene(_:continue:)` on native iOS). Confirm your associated-domains setup is intact and your scene handler processes user activities.

---

## Whats new > Ios 27 uiscene support

**Source:** /integrations/sdk/ios/whats-new/ios-27-uiscene-support

# iOS 27 & UIScene support

Use existing customerio-ios APIs to keep push and deep links working when your app adopts UIScene or is built with the iOS 27 SDK.

If your app adopts `UIScene`, or you build it with the iOS 27 SDK and run it on iOS 27 or later, the system now delivers URLs and universal links to your `UISceneDelegate` instead of your AppDelegate. The current `customerio-ios` 4.7.6 release works with this lifecycle using existing public APIs; it does not require a separate scene-specific release.

**AppDelegate-only apps need no change.** If your app doesn’t adopt `UIScene`, keep your current integration.

When you do adopt `UIScene`:

*   Keep `CustomerIO.initialize`, APNs registration, and `UNUserNotificationCenter` handling in your AppDelegate.
*   Configure `SDKConfigBuilder.deepLinkCallback` to route Customer.io deep-link destinations into your app.
*   Handle cold and warm URLs and universal links in your SceneDelegate (`scene(_:willConnectTo:options:)`, `scene(_:openURLContexts:)`, `scene(_:continue:)`).
*   If you use Live Activities, pass each opened URL through `CustomerIO.liveActivities.handleWidgetUrl(_:)` once before routing.

Customer.io doesn’t add a SceneDelegate or choose which window opens a URL. Your app keeps full control of navigation. The supported scope is one simultaneous window scene.

See the [iOS 27 UIScene migration guide](/integrations/sdk/ios/whats-new/ios-27-uiscene-migration/) for the full walkthrough.

---

