Chatbox SDKs
Give Feedback

iOS Chat SDK

Updated on November 12, 2026

Willing to add a Chat SDK to your iOS mobile app? Get started with Crisp in order to improve your customer support and user engagement today. Made easy thanks to Swift Package Manager — Install it in a few steps.

The Crisp Chat SDK allows you to add a chat widget to your iOS mobile app, enabling your customers to engage with your brand and easily communicate with your team. Just discovering Crisp and our SDK? You can learn more about our Chat SDKs right here.

Notice

The minimum iOS version target for the SDK is iOS 14. Building the SDK requires Xcode 16.3 or later.

Swift documentation

Looking for the extensive Swift documentation? It is available here.

Video Tutorial

Introduction Video


Overview

The Crisp iOS Chat SDK ships as a single library: Crisp. It supports SwiftUI and UIKit, and includes audio and video calls out of the box.

Upgrading from 2.x

  • The minimum deployment target is now iOS 14 (was iOS 13), and the SDK requires Xcode 16.3 or later.
  • The separate CrispWebRTC library is gone. Remove the CrispWebRTC product (Swift Package Manager) or pod (CocoaPods) from your dependencies, depend on Crisp instead, and replace any import CrispWebRTC with import Crisp. Audio and video calls keep working.
  • Both the camera and the microphone usage descriptions are now required in your Info.plist. See Update your Info.plist.

Installation

1. Install the Chat widget SDK to your iOS mobile app

In Xcode, choose File → Add Package Dependencies…, enter the package URL below, and select the Up to Next Major Version rule starting from 3.0.0:

https://github.com/crisp-im/crisp-sdk-ios

Or add it to the dependencies of your Package.swift, and add the Crisp product to all targets that use it:

let package = Package(
  dependencies: [
    .package(url: "https://github.com/crisp-im/crisp-sdk-ios.git", .upToNextMajor(from: "3.0.0")),
  ],
  targets: [
    .target(
      name: "<target-name>",
      dependencies: [
        .product(name: "Crisp", package: "crisp-sdk-ios")
      ]
    )
  ]
)

Option 2: Using CocoaPods (deprecated)

CocoaPods is deprecated and will stop receiving new releases. We recommend migrating to Swift Package Manager (Option 1).

Add Crisp to your CocoaPods Podfile:

use_frameworks!

target :YourTargetName do
  pod 'Crisp'
end

Then run: pod install


2. Update your Info.plist

Both keys below are required. The chat lets your users take photos, record voice messages and start audio and video calls. iOS terminates your app the moment it accesses the camera or the microphone without a usage description, so the SDK shows a configuration error instead of the chat when either key is missing.

Add to your app's Info.plist:

  • Privacy - Camera Usage Description (NSCameraUsageDescription) — needed to take and upload photos to the chat, and to make video calls.
  • Privacy - Microphone Usage Description (NSMicrophoneUsageDescription) — needed to record voice messages, and to make audio and video calls.

Both values are shown to your users in the system permission prompt, so describe what your app uses the camera and the microphone for, for example "Take photos and make video calls in the support chat".

Update Info.plist

3. Configure the Crisp iOS Chat SDK

Go to your Crisp Dashboard, and copy your Website ID:

Copy your Website ID
While you are on your Crisp dashboard, please ensure that the Lock the chatbox to website domain setting has been disabled to avoid Error starting chat errors. This setting can be found in Settings > Website Settings > Chatbox & Email Settings > Chatbox Security.

Then, configure the Website ID once at launch, before you interact with any other SDK method. In SwiftUI, do this in your App initializer:

import Crisp
import SwiftUI

@main
struct MyApp: App {
    init() {
        CrispSDK.configure(websiteID: "YOUR_WEBSITE_ID")
    }

    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

In UIKit, do this in your AppDelegate:

import Crisp
import UIKit

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication,
                     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        CrispSDK.configure(websiteID: "YOUR_WEBSITE_ID")
        return true
    }
}
Configure CrispSDK

4. Present the chat

In SwiftUI, present a ChatView, for example from a sheet:

import Crisp
import SwiftUI

struct ContentView: View {
    @State private var isChatPresented = false

    var body: some View {
        Button("Show chat") {
            self.isChatPresented = true
        }
        .sheet(isPresented: self.$isChatPresented) {
            ChatView()
        }
    }
}

In UIKit, present a ChatViewController:

import Crisp
import UIKit

class ViewController: UIViewController {
    @IBAction func startChat(_ sender: Any) {
        self.present(ChatViewController(), animated: true)
    }
}
Present ChatViewController

Both use ChatViewConfiguration.default unless you pass a configuration. Change it before you present the chat, for example to override the color mode set in your Crisp dashboard:

ChatViewConfiguration.default.colorMode = .dark // .light, .dark or .auto
ChatViewConfiguration.default.activatesTextFieldOnAppear = false

5. Implement Push Notifications (Optional)

Push notifications can be enabled to notify your users when they receive new messages in the Crisp chat, even when your app is in the background or closed.

Push notifications are sent through APNs Production by default, which is required for TestFlight and App Store builds. Development builds installed from Xcode use APNs Sandbox and require enabling Sandbox mode in Settings > Chatbox Settings > Push Notifications. Note that Push notifications are not supported in the Xcode Simulator.

Prerequisites

  1. Create an APNs-enabled private key in your Apple Developer account. Create a new key and Select Apple Push Notifications service (APNs).
  2. Upload your key and configure push notifications in the Crisp web app:
  • Go to Settings > Chatbox Settings > Push Notifications
  • Provide your P8 Certificate, Team ID, Bundle ID and Key ID
Live status will be marked as live once the first push notification got delivered
APNS Settings

5.1 Enable Push Notifications Capability

Enable Push Notifications capability in your Xcode project:

  1. Open your project in Xcode
  2. Select your target
  3. Go to the "Signing & Capabilities" tab
  4. Click the "+" button and add "Push Notifications"
3. APNS Capability

5.2 Implementation

Register for Remote Notifications

First, register for remote notifications in your app delegate:

func application(_ application: UIApplication,
                 didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    UIApplication.shared.registerForRemoteNotifications()
    return true
}

Setting the Device Token

When your app successfully registers for remote notifications, pass the device token to Crisp SDK:

import Crisp

func application(_ application: UIApplication,
                 didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    CrispSDK.setDeviceToken(deviceToken)
}

See setDeviceToken(_:)

Requesting Permission

By default, the chat prompts your users to enable notifications after they sent their first message. Turn this off with CrispSDK.setShouldPromptForNotificationPermission(false) if you'd rather request permission yourself:

do {
    try await UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge])
} catch {
    // Handle the error here.
}

Identifying Crisp Notifications

To determine if a received notification is from Crisp, use the isCrispPushNotification(_:) method:

func userNotificationCenter(_ center: UNUserNotificationCenter,
                            willPresent notification: UNNotification,
                            withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
    if CrispSDK.isCrispPushNotification(notification) {
        // Handle Crisp notification
        CrispSDK.handlePushNotification(notification)
        completionHandler([.banner, .sound])
    } else {
        // Handle other notifications
        completionHandler([])
    }
}

Handling Crisp Notifications

When a Crisp notification is received, use the handlePushNotification(_:) method to process it:

func userNotificationCenter(_ center: UNUserNotificationCenter,
                            didReceive response: UNNotificationResponse,
                            withCompletionHandler completionHandler: @escaping () -> Void) {
    let notification = response.notification
    if CrispSDK.isCrispPushNotification(notification) {
        CrispSDK.handlePushNotification(notification)
    } else {
        // Handle other notifications
    }
    completionHandler()
}

Session continuity

If your users log in to your app, you can bind their Crisp session to a token, so they find the same conversation on every device. A token is a private value known to your system, such as a user ID. Each user must have a different token.

// When the user logs in
CrispSDK.setTokenID(tokenID: "A_CUSTOM_ID")
CrispSDK.session.reset() // Not needed if the chat wasn't presented yet

// When the user logs out
CrispSDK.setTokenID(tokenID: nil) // 1. Clear the token value
CrispSDK.session.reset()          // 2. Unbind the current session

Resetting the session doesn't delete the conversation on Crisp, it only unbinds the app from it. The conversation comes back when the user logs in again with the same token. Learn more about session continuity.


Available APIs

Swift APIs

The extensive Swift documentation is available here.

Configuration
  • CrispSDK.configure(websiteID: "YOUR_WEBSITE_ID") — Configures the SDK with a website_id
  • CrispSDK.setTokenID(tokenID: "A_CUSTOM_ID") — Assigns session with a token_id (pass nil to clear it)
  • CrispSDK.setShouldPromptForNotificationPermission(false) — Disables the in-chat prompt to enable notifications (enabled by default)
  • CrispSDK.unsafeDisableMissingUsageDescriptionWarnings() — Lets the chat start even though the camera or microphone usage descriptions are missing (not recommended, iOS still terminates your app when the chat accesses the camera or the microphone)
  • CrispSDK.version — Returns the version of the SDK
Presenting the chat
  • ChatView() — The chat for SwiftUI
  • ChatViewController() — The chat for UIKit
  • CrispSDK.openChat() — Opens the chat tab
  • CrispSDK.searchHelpdesk() — Opens the helpdesk
  • CrispSDK.openHelpdeskArticle(locale: "en", slug: "1h6ppad", title: nil, category: nil) — Opens a helpdesk article
User
  • CrispSDK.user.email = "john.doe@gmail.com" — Sets user email
  • CrispSDK.user.signature = "SHA256_SIGNATURE" — Sets the email signature to verify the user identity (as part of the Identity Verification feature; must be a valid HMAC-SHA256 hex digest, set together with — or after — email)
  • CrispSDK.user.nickname = "John Doe" — Sets user name
  • CrispSDK.user.phone = "003370123456789" — Sets user phone
  • CrispSDK.user.avatar = URL(string: "https://example.com/avatar.jpg") — Sets user avatar
  • CrispSDK.user.company = Company(name: "Acme", url: nil, companyDescription: nil, employment: nil, geolocation: nil) — Sets user company
Session
  • CrispSDK.session.setString("custom_value", forKey: "custom_key") — Sets session data string
  • CrispSDK.session.setInt(42, forKey: "custom_key") — Sets session data int
  • CrispSDK.session.setBool(true, forKey: "custom_key") — Sets session data bool
  • CrispSDK.session.getString(forKey: "custom_key") — Gets session data string (also getInt and getBool)
  • CrispSDK.session.pushEvents([SessionEvent(name: "Signup", color: .blue)]) — Pushes an array of events
  • CrispSDK.session.setSegments(["app", "premium"], overwrite: false) — Sets session segments
  • CrispSDK.session.runBotScenario(id: "SCENARIO_ID") — Runs a Bot scenario
  • CrispSDK.session.identifier — Returns the session identifier, once the session has loaded
  • CrispSDK.session.isOngoing — Returns whether messages have been exchanged in the session
  • CrispSDK.session.reset() — Resets the session
Messages
  • CrispSDK.showMessage(with: .text("Hello! How can we help?")) — Shows a message as operator in the local chatbox
Callbacks
  • let token = CrispSDK.addCallback(.messageReceived { message in ... }) — Adds a callback for chatbox events: chatOpened, chatClosed, messageSent, messageReceived and sessionLoaded
  • CrispSDK.removeCallback(token: token) — Removes a callback

Examples of Crisp implementation on iOS apps

If you are looking to find examples of real-world exemples from our customers, we have you covered. Below you will find a selection of hand-picked iOS apps showcasing how our chatbox feels and looks on your Apple device.

  • RunMotion Coach — is a running planner application to help meet your objectives
  • Jomo — helps you manage your screen time and stay focused throughout your day
  • Emma-app — serves as a friendly budget management and financial companion
  • Savvy Navvy — acts as your own digital coral reef to prepare against the tides