Getting started

The Ada iOS SDK is a framework that you can use to embed your Ada AI agent into your native iOS application.

It also supports actions and settings that you can use to customize the behavior of your AI Agent. For example, you might want to set the language, or pass metadata. The iOS SDK reference covers these options and more.

This guide covers the new Ada Messaging iOS SDK (AdaMessaging). If you are migrating from the legacy SDK (AdaEmbedFramework), see Upgrade from the Legacy iOS SDK below.

Compatibility

RequirementMinimum Version
iOS16.0
Swift5.9
XcodeCurrent toolchain with Swift 5.9 support

Ada will add support for new iOS versions as they become generally available, and will continue to support and test for two versions behind the current version.

Install the iOS SDK

You can install the Ada iOS SDK using Swift Package Manager, CocoaPods, Carthage, or manually. Swift Package Manager is the recommended installation path.

Via Xcode:

  1. Open File > Add Package Dependencies…
  2. Enter the repository URL: https://github.com/ada-cx-public/messaging-ios.git
  3. Choose the release version you want to ship.
  4. Add the AdaMessaging product to your app target.

Via Package.swift:

Swift
1dependencies: [
2 .package(url: "https://github.com/ada-cx-public/messaging-ios.git", from: "1.0.2"),
3],
4targets: [
5 .target(
6 name: "YourTarget",
7 dependencies: ["AdaMessaging"]
8 ),
9]

Install using CocoaPods

The AdaMessaging CocoaPod is public, however, use of the chat interface is gated. To gain access please reach out to an Ada Account Manager.

  1. Add AdaMessaging to your Podfile.

  2. Install the pod using: pod install.

Swift
1# Podfile
2platform :ios, '16.0'
3
4target 'MyApp' do
5 use_frameworks!
6
7 # Pods for MyApp
8 pod "AdaMessaging", :git => "https://github.com/ada-cx-public/messaging-ios", :tag => "1.0.2"
9
10end

Install using Carthage

Add the following to your Cartfile:

Swift
1github "ada-cx-public/messaging-ios" ~> 1.0.2

Then run:

$carthage update --use-xcframeworks

Add AdaMessaging.xcframework to your app target in Xcode.

Install iOS SDK manually

  1. Download AdaMessaging.xcframework.zip from the latest release here.
  2. Right-click on the project file in Xcode, then click Add Files to MyProjectName. Ensure that the groups option is selected.
  3. Ensure your Deployment Target is set to 16.0 or higher.
  4. In your target’s General settings, add AdaMessaging.xcframework under Frameworks, Libraries, and Embedded Content with Embed & Sign selected.

Import the framework

Once you’ve installed the Ada iOS SDK, you’re ready to use it in your app!

  1. Import AdaMessaging into your controller.
  2. Create an instance of the AdaWebHost, as in the example below, replacing my-bot with the actual name of your bot.
Swift
1import AdaMessaging
2
3// ...
4
5lazy var adaWebHost = AdaWebHost(handle: "my-bot")

The lazy property prevents AdaWebHost from initializing until the property is used. Use of this property may help to prevent unwanted end users from being created in the background.

You can also pass optional configuration at initialization:

Swift
1let adaWebHost = AdaWebHost(
2 handle: "my-bot",
3 language: "en",
4 metafields: [
5 "plan": "pro",
6 "signedIn": true,
7 ]
8)

Most apps only need handle. Leave cluster and domain unset unless Ada tells you your AI agent is hosted on a non-default regional cluster or custom domain.

Launch Ada

Finally, launch Ada using one of the three opening methods:

  • launchModalWebSupport — Presents the chat as a modal overlay.
  • launchNavWebSupport — Pushes the chat onto the navigation stack.
  • launchInjectingWebSupport — Injects the chat view into an existing view.
Swift
1adaWebHost.launchModalWebSupport(from: self)

Runtime commands

You can interact with the Ada chat instance at runtime using the following methods.

Set metadata

Use MetaFields.Builder to pass public or sensitive metadata to Ada:

Swift
1let publicFields = MetaFields.Builder()
2 .setField(key: "plan", value: "pro")
3 .setField(key: "signedIn", value: true)
4
5let sensitiveFields = MetaFields.Builder()
6 .setField(key: "authToken", value: "secure-session-token")
7
8adaWebHost.setMetaFields(builder: publicFields)
9adaWebHost.setSensitiveMetaFields(builder: sensitiveFields)

Dictionary overloads for setMetaFields and setSensitiveMetaFields still exist for backward compatibility but are deprecated. Use MetaFields.Builder for all new code.

Set language

Swift
1adaWebHost.setLanguage(language: "fr")

Set device token

Swift
1adaWebHost.setDeviceToken(deviceToken: "apns-device-token")

Trigger a specific answer

Swift
1adaWebHost.triggerAnswer(answerId: "response-id")

Reset the chat

Swift
1adaWebHost.reset(
2 language: "en",
3 metaFields: publicFields,
4 sensitiveMetaFields: sensitiveFields,
5 resetChatHistory: true
6)

Delete chat history

Swift
1adaWebHost.deleteHistory()

Info.plist permissions

If your AI Agent flow allows users to upload images, videos, or use the camera, add the corresponding usage descriptions to your app’s Info.plist:

KeyWhen Required
NSCameraUsageDescriptionCamera capture uploads
NSPhotoLibraryUsageDescriptionPhoto library uploads
NSMicrophoneUsageDescriptionVideo capture with audio

Upgrade from the Legacy iOS SDK

If you are migrating from the legacy AdaEmbedFramework, the new Messaging SDK is designed as a drop-in replacement. AdaWebHost remains the main public class — most apps only need a dependency swap and an import rename.

Migration steps

  1. Replace the old dependency with AdaMessaging.
  2. Rename the framework import from AdaEmbedFramework to AdaMessaging.
  3. Keep your existing AdaWebHost usage as-is.

Side-by-side mapping

LegacyMessaging SDK
AdaEmbedFrameworkAdaMessaging
AdaEmbedFramework.xcframeworkAdaMessaging.xcframework
pod "AdaEmbedFramework"pod "AdaMessaging"
import AdaEmbedFrameworkimport AdaMessaging

Before / after: imports

Swift
1// Before
2import AdaEmbedFramework
3
4// After
5import AdaMessaging

Before / after: CocoaPods

Swift
1# Before
2pod "AdaEmbedFramework"
3
4# After
5pod "AdaMessaging", :git => "https://github.com/ada-cx-public/messaging-ios", :tag => "1.0.2"

Use MetaFields.Builder for new code

Dictionary overloads for setMetaFields, setSensitiveMetaFields, and some reset shapes still exist for backward compatibility but are deprecated. For all new code, prefer MetaFields.Builder:

Swift
1let publicFields = MetaFields.Builder()
2 .setField(key: "plan", value: "pro")
3 .setField(key: "signedIn", value: true)
4
5let sensitiveFields = MetaFields.Builder()
6 .setField(key: "authToken", value: "secure-session-token")
7
8adaWebHost.setMetaFields(builder: publicFields)
9adaWebHost.setSensitiveMetaFields(builder: sensitiveFields)
10adaWebHost.reset(
11 language: "en",
12 metaFields: publicFields,
13 sensitiveMetaFields: sensitiveFields,
14 resetChatHistory: true
15)

Release checklist

Before shipping your integration or migration to production:

  • Verify your real production bot handle launches successfully
  • Test the exact presentation mode you ship (modal, navigation push, or inline)
  • Confirm any event logging still receives SDK events
  • Test push token registration if your app depends on it
  • Test reset() and deleteHistory() if your app exposes those actions