
Swift
iOS Chat SDK
TalkJS’s Swift Data API is a native, headless SDK for adding real-time chat to iOS apps. You build the UI in SwiftUI or UIKit, while TalkJS handles real-time messaging, presence, and push notifications through APNs.
Everything you need for real-time iOS messaging
The TalkJS Swift Data API gives your iOS app the core messaging features of a chat SDK, with real-time updates delivered to your own Swift views.
Send text messages and reply to a specific message, so threads of conversation stay clear in busy chats.
Subscribe to the user’s most recently active conversations to build an inbox that updates as new messages arrive.
Show when someone’s typing in a conversation. Indicators clear automatically after 10 seconds or when a message is sent.
Foodies





Channel5 members
Subscribe to a user’s online status to show who’s available before your users start a conversation.
Mark a conversation as read when the user opens it, or as unread so they can come back to it later.
import { Chatbox } from '@talkjs/react-components';
import "@talkjs/react-components/default.css";
import { TalkSession } from "@talkjs/core";
import { useEffect } from "react";
function Chat() { const appId = '<APP_ID>'; const userId = 'frank'; const otherUserId = 'nina'; const conversationId = 'new_conversation'; const session = getTalkSession({ appId, userId });
useEffect(() => { session.currentUser.createIfNotExists({ name: 'Frank' }); session.user(otherUserId).createIfNotExists({ name: 'Nina' });
const conversation = session.conversation(conversationId);
conversation.createIfNotExists();
conversation.participant(otherUserId).createIfNotExists();
}, [session, conversationId, otherUserId]);
return ( <div style={{ width: '400px', height: '800px' }}> <Chatbox
appId={appId}
userId={userId}
conversationId={conversationId}
/> </div> ); } 

Let users react to messages with Unicode or custom emoji, with up to 50 different reactions per message.

Upload and send images, files, videos, audio, and voice recordings, or share a location pin in a conversation.
Explore Travel
now
Flight update
Check in online for your Singapore flight tomorrow. Upgrade to priority boarding.
Register a device’s APNs token on the user to notify them of new messages when your app isn’t in the foreground.
Get started in three steps
Install the Swift Data API, connect as a user, and send your first message in three steps.
01
Add the Swift package
In Xcode, choose File > Add Package Dependencies..., enter https://github.com/talkjs/talkjs-core-swift, and add the talkjs-core-swift library to your app target. If you use a Package.swift file, add the package as a dependency instead:
dependencies: [
.package(url: "https://github.com/talkjs/talkjs-core-swift", from: "<latest_version>"),
]02
Create a session
Import the talkjs_core_swift module and create a session for the current user with your TalkJS app ID, found on the Settings page of your TalkJS dashboard:
import talkjs_core_swift
let session = getTalkSession(
appId: "<APP_ID>", // Replace with your own app ID
userId: "<USER_ID>" // Replace with a user ID
)03
Subscribe to messages and send one
Get a reference to a conversation, subscribe to its messages, and send a message:
let conversation = session.conversation(id: "<CONVERSATION_ID>")
// Called with the latest messages whenever they change
let subscription = conversation.subscribeMessages { messages, loadedAll in
print(messages?.map { $0.plaintext } ?? [])
}
Task {
try await conversation.createIfNotExists()
try await conversation.send(text: "Hello")
}You’re now ready to build your inbox and chat views on top of real-time conversation data.
Read the full Swift Data API docsBuild your own UI with real-time data from TalkJS
The TalkJS Swift Data API is a headless messaging layer for iOS apps. It connects to TalkJS as a specific user and exposes Swift functions for creating conversations, sending messages, and subscribing to real-time updates. You render that data with SwiftUI, UIKit, or a mix of both, with no TalkJS-provided views in the render path.
Each subscription calls your code with a fresh snapshot whenever its data changes, so your views always show the current messages, typing status, and presence. The same talkjs-core-swift package also runs in macOS 11+ apps.
The Swift Data API shares the same core as the TalkJS Kotlin Data API, so the method names match on Android. If you ship native apps for both platforms, your iOS and Android teams work with the same concepts and calls.
Connect AI agents via REST and webhooks
Power AI agents and LLM-backed conversations by pairing your iOS chat with the TalkJS REST API and webhooks. You can trigger a response, route to a bot, or hand off to a human agent, all from your own backend. TalkJS doesn’t bundle a specific AI or bot framework, so you stay in control of the model and logic you use.
A typical pattern: a webhook fires when a user sends a message, your backend calls an LLM, and the REST API sends the response back into the conversation. The Swift Data API connects as a single user, so server-side work like this goes through the REST API. Your iOS app needs no special handling: it receives the AI’s reply as a normal message.
Works with your stack
In addition to the native Swift Data API for iOS, TalkJS supports native Android, cross-platform mobile, web, and server-side integrations.
Mobile
Pair your iOS app with a native Android app, or target both platforms from a single codebase.
The Kotlin Data API is a native, headless chat SDK for Android. It shares its core and method names with the Swift Data API for iOS.
Pre-built chat UI components for React Native apps, or use the JavaScript Data API for real-time data with a fully custom UI.
Pre-built chat UI widgets for Flutter apps on iOS and Android. Add real-time messaging to both platforms from a single codebase.
Web
Add chat to the web version of your app with pre-built UI components for your framework.
Server-side
Connect to chat data from your backend to manage users, conversations, and messages, or to power AI agents and integrations.
Built for every messaging need
Teams use TalkJS to add chat to their iOS apps across industries, from marketplaces and on-demand services to healthcare.

Buyer-seller messaging with file sharing and push notifications, so deals don’t stall while someone waits for a reply.
Add white-label, in-app messaging to your iOS app without building or maintaining your own real-time infrastructure.

Driver-rider or provider-customer chat for delivery, ride-hailing, and field service apps, with real-time presence and push notifications.
Pair your iOS app with the REST API and webhooks to power AI agents and LLM-backed conversations.
Foodies





Channel5 members
Multi-participant conversations with typing indicators, read state, and reactions, ready for team or community chat in your app.

Patient-provider messaging with location sharing and file or image attachments for care coordination.
We were able to offload all messaging to TalkJS — hugely simplifying our development of an otherwise complex stack.
How TalkJS compares for iOS
See how the TalkJS Swift Data API compares with other iOS chat SDKs on UI options, requirements, installation, and pricing.
CometChat | ||||
|---|---|---|---|---|
| Native iOS UI kit | TalkJS No (headless) | Sendbird UIKit and SwiftUI | Stream UIKit and SwiftUI | CometChat SwiftUI UI Kit |
| Headless client SDK | TalkJS Swift Data API | Sendbird Chat SDK | Stream Low-level client (StreamChat) | CometChat CometChat SDK |
| Minimum iOS version | TalkJS iOS 15 | Sendbird iOS 13 | Stream iOS 13 (SwiftUI kit: iOS 14) | CometChat iOS 11 (SDK), iOS 13 (UI Kit) |
| Installation | TalkJS Swift Package Manager | Sendbird Swift Package Manager, CocoaPods, Carthage | Stream Swift Package Manager | CometChat Swift Package Manager, CocoaPods |
| Push notifications via APNs | TalkJS Yes | Sendbird Yes | Stream Yes (APNs or Firebase) | CometChat Yes |
| Free tier | TalkJS Development mode, all features | Sendbird Free trial: up to 1,000 MAU, 20 concurrent connections | Stream Build plan: 1,000 MAU free | CometChat Build plan: up to 100 users |
| Price at 10,000 MAU (USD per month, billed annually) | TalkJS Basic: $239 | Sendbird Starter: $429 | Stream Start: $399 | CometChat Basic: $299 |


