Documentation

Documentation

YourOwn SetupYourOwn SDKYourOwn API
Sphere SetupSphere SDKSphere API
  • Resources

›Getting started

Getting started

  • Copilot.cx Mobile SDK
  • Importing the iOS SDK
  • Importing the Android SDK
  • SDK configuration

Getting started for flutter

  • Importing the Copilot.cx Android SDK for Flutter
  • Importing the Copilot.cx iOS SDK for Flutter
  • Interacting with the Copilot.cx SDK in Dart

Getting around

  • Hello Copilot

Reference

  • Manage session
  • Report
  • In-app messages
  • Authentication

Event reporting guide

  • Predefined events
  • Custom events

Appendix

  • Releases
  • Open source mapping

Importing the iOS SDK

SDK versions compatibility and requirements

Please refer the releases page for to get specific version.

Using Swift Package Manager(SPM)

In your Package.swift file add Copilot SDK repo:

    dependencies: [
        .package(url: "https://bitbucket.org/teamcopilot/copilot-sdk-ios-pub.git", .upToNextMajor(from: "YOUR_COPILOT_IOS_SDK_VERSION_HERE"))
    ]

💡 Replace YOUR_COPILOT_IOS_SDK_VERSION_HERE with latest version of Copilot SDK

Using CocoaPods

Starting with version 6.0.7, new updates of the pod will no longer be pushed to the private CocoaPod but will instead be pushed to the public CocoaPods trunk.

Here few steps to follow in order to install successfully the iOS SDK:

  1. Navigate to your project folder in a terminal window.
  2. Make sure you have the CocoaPods gem installed on your machine before installing the Copilot.cx pod. This will create a file named Podfile in your project's root directory.
$ sudo gem install cocoapods  
  1. Create the Podfile - you can the Podfile with a text editor or execute the pod init command at the root of your Xcode project.
$ pod init
  1. Add the Copilot.cx SDK pod to your Podfile (please refer the releases page for to get specific version):
# For example pod 'Copilot', '10.10.10'
pod 'Copilot', 'YOUR_COPILOT_IOS_SDK_VERSION_HERE'

Please make sure you use specific versions of the SDK in your podfile.

  1. Finally, run the following commands in your project root directory from the terminal window:
$ pod install
$ open <your project>.xcworkspace
  1. Add a new Property List file (.plist) to your project and name it Copilot-Info.plist. it should look like this :

External authentication

Source representation:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>Authentication Params</key>
        <dict>
            <key>ENVIRONMENT_URL</key>
            <string>COPILOT_ENVIRONMENT_URL_HERE</string>
        </dict>
        <key>MANAGE_TYPE</key>
        <string>YourOwn</string>
    </dict>
</plist>

💡 Please note, you can configure the SDK to work with different Plist files based on your application configuration when setting up Copilot.cx instance in your AppDelegate. Copilot.setup(analyticsProviders: [FirebaseAnalyticsEventLogProvider()], customPlistName: "AlternateCopilot-Info")

  1. Replace COPILOT_ENVIRONMENT_URL_HERE with the appropriate value (please refer the SDK configuration section)

  2. Add the FirebaseAnalyticsEventLogProvider class implementing the EventLogProvider protocol to your project.

Make sure you called the FirebaseApp.configure() method in your project (as an example, you can call it in your AppDelegate).

Make sure you enable/disable analytics collection per the application GDPR compliance and your user's consent by calling AnalyticsConfiguration.shared().setAnalyticsCollectionEnabled(true)

import Foundation
import Firebase
import FirebaseAnalytics
import CopilotCX

class FirebaseAnalyticsEventLogProvider: EventLogProvider {
    
    func enable() {
      // No implementation
    }

    func disable() {
      // No implementation
    }

    func setUserId(userId:String?){
        Analytics.setUserID(userId)
    }
    
    func transformParameters(parameters: Dictionary<String, String>) -> Dictionary<String, String> {
        return parameters
    }
    
    func logCustomEvent(eventName: String, transformedParams: Dictionary<String, String>) {
        Analytics.logEvent(eventName, parameters: transformedParams)
    }

    var providerName: String {
        return "FirebaseAnalyticsEventLogProvider"
    }
}
  1. Add in Online Marketplaces Support to make sure iOS can support Marketplace Actions.

  2. Initialize Copilot.cx in your AppDelegate class setting it with a list of EventLogProvider protocol implementations as shown below (please refer the Managing providers section).

import CopilotCX

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: 
    [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        Copilot.setup(analyticsProviders: [FirebaseAnalyticsEventLogProvider()])
            .enableDebugLogs()
        return true
}

💡 You may add other EventLogProvider per your need. Every event will be dispatched to every provider configured in the system. It is suggested to add a console log only event provider for event dispatching debugging purposes.


Copilot logs are disabled by default. To enable them, add the enableDebugLogs() command as shown in the example, Or by calling the function through the Copilot object: Copilot.instance.enableDebugLogs()

  1. Add Google Firebase to your iOS project following this guide : Add firebase to your iOS Project. Make sure you will end up with GoogleService-Info.plist file in your project.

  2. In every file you would like to use Copilot.cx make sure you import CopilotCX:

import CopilotCX

Updating the iOS SDK

The client SDK is backward compatible, but it should correlate with the versioning of Copilot.cx Cloud. Make sure you update the pod version after approving that current Copilot.cx Cloud version can support the latest SDK version.

  1. In your project's podfile update Copilot.cx SDK with a new version number, Please refer the releases page for to get specific version.
# For example pod 'Copilot', '10.10.10'
pod 'Copilot', 'YOUR_COPILOT_IOS_SDK_VERSION_HERE'
  1. Update the specific pod executing:
pod update 'Copilot'
← Copilot.cx Mobile SDKImporting the Android SDK →
  • SDK versions compatibility and requirements
    • Using Swift Package Manager(SPM)
    • Using CocoaPods
Copilot
Mail: hello@copilot.cx
Call: (212).398.0001
© Copilot.cx 2025