CustomerIOCommon 3.1.3

CustomerIOCommon 3.1.3

Maintained by CustomerIO Engineering.



  • By
  • CustomerIO Team

Power automated communication that people like to receive.

min swift version is 5.3 min ios version is 13 Contributor Covenant codecov

Customer.io iOS SDK

This is the official Customer.io SDK for iOS.

You'll find our complete SDK documentation at https://customer.io/docs/sdk/ios. This readme only contains basic information to help you install and initialize the SDK.

The SDK has been tested on iOS devices. It might work on other Apple devices—macOS, tvOS, and watchOS—but we have not officially tested, nor do we officially support, non-iOS devices.

Using version 1 of our SDK?

It's recommended to upgrade to using version 2 of the iOS SDK. Check out our migration docs to learn how to update your app.

Summary

To get started, you need to install and initialize the relevant SDK packages in your project.

We've separated our SDK into packages to minimize our impact on your app's size. You should only install the packages that you need for your project.

Package Required? Description
Tracking Yes identify people/devices and send events (to trigger campaigns, track metrics, etc).
MessagingPushAPN No Push and rich push notifications using Apple's Push Notification service (APNs).
MessagingPushFCM No Push and rich push notifications using Firebase Cloud Messaging (FCM).

Tip: Check out our sample iOS app, Remote Habits, for a real-world example using our SDK.

Install the SDK

Follow Apple's instructions to add https://github.com/customerio/customerio-ios.git as a dependency to your project in Xcode and select the individual package products that you want to install.

We recommend that you 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.

in XCode select up to next major version when installing the SDK

Initialize the SDK

Before you can use the Customer.io SDK, you need to initialize it. Any calls that you make to the SDK before you initialize it are ignored.

To get started, initialize the SDK in the AppDelegate application(_ application: didFinishLaunchingWithOptions) function:

import CioTracking

class AppDelegate: NSObject, UIApplicationDelegate {
    func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
    ) -> Bool {
        CustomerIO.initialize(siteId: "YOUR SITE ID", apiKey: "YOUR API KEY", region: Region.EU) { config in 
          // optionally, configure the SDK for your app's needs
        }

        return true
    }
}

Then, when you want to use any of the SDK features, you use the shared instance of the class:

CustomerIO.shared.track(...)
MessagingPush.shared.application(...)

More information

See our complete SDK documentation at https://customer.io/docs/sdk/ios/

Contributing

Thanks for taking an interest in our project! We welcome your contributions. Check out our development instructions to get your environment set up and start contributing.

Note: We value an open, welcoming, diverse, inclusive, and healthy community for this project. We expect all contributors to follow our code of conduct.

License

MIT