Skip to main content
Version: 5.9.0

Quick start

Minimal SDK integration — from setup to opening a chat.

What you need

  • Xcode 16+, iOS 14.0+, Swift 5
  • providerUid — unique application key (issued by edna during integration)
  • Server URLs — REST, WebSocket, DataStore (issued by edna) or a cloud host name
  • SDK connected — CocoaPods, SPM or manually (instructions)
No connection details?

Write to support@edna.io — they will provide a providerUid and the addresses for your environment.

Option 1. Try the demo app

A ready-made project for running the SDK without changing your code.

  1. Clone ChatCenterDemo.

  2. Open ChatCenterDemo.xcodeproj in Xcode.

  3. Edit Resources/servers.json — specify your connection details:

[
{
"name": "My server",
"isSelected": true,
"restURL": "https://your-host.edna.io",
"webSocketURL": "wss://your-host.edna.io/socket",
"dataStoreURL": "https://your-host.edna.io/files",
"providerUid": "YOUR_PROVIDER_UID",
"apiVersion": 17
}
]
  1. Run in the simulator. For a physical device, change the Bundle Identifier to your own and configure signing.

  2. Select a server and a user, tap Log in — the chat screen will open.

Alternative to editing JSON

Servers and users can also be added directly from the demo UI.

Option 2. Minimal integration into your app

Step 1. Connect the SDK

Add the framework — see options in the Installation section.

Step 2. Initialize the SDK

import ChatCenterUI

let transport = ChatTransportConfig(cloudHost: "your-host.edna.io")
let chatConfig = ChatConfig(transportConfig: transport)

// Usually in AppDelegate
let chatCenterSDK = ChatCenterUISDK(
providerUid: "YOUR_PROVIDER_UID",
chatConfig: chatConfig
)

Step 3. Authorize the user

let chatUser = ChatUser(identifier: "unique_user_id", name: "User name")

// Set delegate before authorize — otherwise you will miss the counter and network errors during the first sync
chatCenterSDK.delegate = self

chatCenterSDK.authorize(user: chatUser)
Identifier security

Do not use a phone number, email or other personal data as the identifier — see identifier requirements.

authorize does not return a result

The method is not throwing and has no completion. There is no explicit "success" event in the delegate — network errors arrive in chatCenterUI(chatCenter:didReceiveNetwork:). Without a delegate, errors are not delivered to client code. See SDK delegate for details.

Step 4. Open the chat

do {
let chatController = try chatCenterSDK.getChat()
navigationController?.pushViewController(chatController, animated: true)
} catch let error as ChatCenterUIError {
print("Failed to open chat: \(error)")
}

getChat() throws a typed ChatCenterUIError — full list in the Error reference.

What's next