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
Swift documentation
Looking for the extensive Swift documentation? It is available here.
Video Tutorial
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
CrispWebRTClibrary is gone. Remove theCrispWebRTCproduct (Swift Package Manager) or pod (CocoaPods) from your dependencies, depend onCrispinstead, and replace anyimport CrispWebRTCwithimport 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
Option 1: Using Swift Package Manager (recommended)
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)
Add Crisp to your CocoaPods Podfile:
use_frameworks!
target :YourTargetName do
pod 'Crisp'
end
Then run: pod install
2. Update your Info.plist
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".

3. Configure the Crisp iOS Chat SDK
Go to your Crisp Dashboard, and copy your Website ID:

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
}
}

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

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.
Prerequisites
- Create an APNs-enabled private key in your Apple Developer account. Create a new key and Select
Apple Push Notifications service (APNs). - 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

5.1 Enable Push Notifications Capability
Enable Push Notifications capability in your Xcode project:
- Open your project in Xcode
- Select your target
- Go to the "Signing & Capabilities" tab
- Click the "+" button and add "Push Notifications"

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)
}
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_idCrispSDK.setTokenID(tokenID: "A_CUSTOM_ID")— Assigns session with a token_id (passnilto 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 SwiftUIChatViewController()— The chat for UIKitCrispSDK.openChat()— Opens the chat tabCrispSDK.searchHelpdesk()— Opens the helpdeskCrispSDK.openHelpdeskArticle(locale: "en", slug: "1h6ppad", title: nil, category: nil)— Opens a helpdesk article
User
CrispSDK.user.email = "john.doe@gmail.com"— Sets user emailCrispSDK.user.signature = "SHA256_SIGNATURE"— Sets the email signature to verify the user identity (as part of the Identity Verification feature; must be a validHMAC-SHA256hex digest, set together with — or after —email)CrispSDK.user.nickname = "John Doe"— Sets user nameCrispSDK.user.phone = "003370123456789"— Sets user phoneCrispSDK.user.avatar = URL(string: "https://example.com/avatar.jpg")— Sets user avatarCrispSDK.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 stringCrispSDK.session.setInt(42, forKey: "custom_key")— Sets session data intCrispSDK.session.setBool(true, forKey: "custom_key")— Sets session data boolCrispSDK.session.getString(forKey: "custom_key")— Gets session data string (alsogetIntandgetBool)CrispSDK.session.pushEvents([SessionEvent(name: "Signup", color: .blue)])— Pushes an array of eventsCrispSDK.session.setSegments(["app", "premium"], overwrite: false)— Sets session segmentsCrispSDK.session.runBotScenario(id: "SCENARIO_ID")— Runs a Bot scenarioCrispSDK.session.identifier— Returns the session identifier, once the session has loadedCrispSDK.session.isOngoing— Returns whether messages have been exchanged in the sessionCrispSDK.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,messageReceivedandsessionLoadedCrispSDK.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