Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions sdk/ios/llms-ios-v4.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
title: "iOS Chat SDK v4 — LLM docs index"
description: "Machine-readable, iOS-SDK-v4-scoped index of every Chat SDK page as a clean .md twin. Built for AI coding agents; kept out of the human sidebar."
---

{/*
SCOPED LLM INDEX for the iOS Chat SDK v4.
- UNLISTED, NOT hidden: intentionally omitted from docs.json navigation so it never shows in
the human sidebar — but it IS built, served as a clean .md twin, and INDEXED for search +
AI assistants (so AI tools, and the skills pack via its docs-map, can discover and read it).
- We deliberately do NOT use `hidden: true`/`noindex` here: in Mintlify `hidden` auto-applies
noindex, which would drop this page from search AND the auto global llms.txt / AI context.
We want it discoverable, so it stays indexable.
- Scope is v4 ONLY. The 2.0/ and 3.0/ trees are deliberately excluded — linking them would
route agents at dead API surfaces.
*/}

# iOS Chat SDK v4 — LLM docs index (Latest)

> Headless Swift chat SDK. Package `CometChatSDK@4`. This page is an **iOS-SDK-v4-only** routing
> index for AI agents — a scoped alternative to the site-wide `/docs/llms.txt`.

## How to use this index
Each link points to the docs page; **append `.md`** to its URL to fetch the clean Markdown twin.
Each page opens with an **"AI Integration Quick Reference"** block (package · import · key
methods) — read that FIRST, then the body for the full call.
- Convention: any docs page URL + `.md` → raw Markdown.
- Fallback: if a `.md` twin 404s, fetch the same URL **without** `.md` (HTML).
- Never answer a method signature from memory, and never read the framework binary's
`.swiftinterface` to decide *behaviour* — it proves a symbol exists, nothing more.

## When to use this index
Two cases:
1. **Headless app** — no CometChat UI, you are building your own views on the SDK.
2. **UI Kit fallback** — the app uses the iOS UI Kit v5, but the feature you need ships **no UI
Kit component** (AI agents, campaigns, moderation, adding group members, transient messages,
low-level presence, webhooks). Check the kit first
([iOS UI Kit v5 index](/ui-kit/ios/llms-ios-v5)); if there is no component, come here.

## API facts an agent must not guess
- Callbacks use `.success` / `.onError` — **not** Swift's `Result.failure`.
- `CometChatException` does **not** conform to Swift's `Error`; read `errorDescription`, not
`localizedDescription`, and downcast with `error as? CometChatException`.
- Request objects use the **builder** pattern (`MessagesRequest.MessagesRequestBuilder`), and
listeners are registered per-class with a unique identifier you must later remove.
- In SwiftUI hosts, qualify SDK types (`CometChatSDK.User`, `CometChatSDK.Group`) — SwiftUI
declares its own `Group`.

## Getting started
- [iOS SDK](/sdk/ios/overview)
- [Setup](/sdk/ios/setup)
- [Key Concepts](/sdk/ios/key-concepts)
- [Authentication](/sdk/ios/authentication-overview)
- [Changelog](/sdk/ios/changelog)
- [Upgrading From V3](/sdk/ios/upgrading-from-v3-to-v4)
- [Rate Limits](/sdk/ios/rate-limits)

## Messaging
- [Send Messages](/sdk/ios/send-message)
- [Receive Messages](/sdk/ios/receive-message)
- [Edit Message](/sdk/ios/edit-message)
- [Delete Message](/sdk/ios/delete-message)
- [Flag Message](/sdk/ios/flag-message)
- [Message Filtering](/sdk/ios/additional-message-filtering)
- [Message Structure And Hierarchy](/sdk/ios/message-structure-and-hierarchy)
- [Threaded Messages](/sdk/ios/threaded-messages)
- [Transient Messages](/sdk/ios/transient-messages)
- [Upload Files & Send Attachments](/sdk/ios/upload-files)
- [Reactions](/sdk/ios/reactions)
- [Mentions](/sdk/ios/mentions)
- [Delivery & Read Receipts](/sdk/ios/delivery-read-receipts)
- [Typing Indicators](/sdk/ios/typing-indicators)

## Conversations
- [Retrieve Conversations](/sdk/ios/retrieve-conversations)
- [Delete Conversation](/sdk/ios/delete-conversation)

## Users
- [Users](/sdk/ios/users-overview)
- [User Management](/sdk/ios/user-management)
- [Retrieve Users](/sdk/ios/retrieve-users)
- [User Presence](/sdk/ios/user-presence)
- [Block Users](/sdk/ios/block-users)

## Groups
- [Groups](/sdk/ios/groups-overview)
- [Create A Group](/sdk/ios/create-group)
- [Update A Group](/sdk/ios/update-group)
- [Delete A Group](/sdk/ios/delete-group)
- [Join A Group](/sdk/ios/join-group)
- [Leave A Group](/sdk/ios/leave-group)
- [Retrieve Groups](/sdk/ios/retrieve-groups)
- [Retrieve Group Members](/sdk/ios/retrieve-group-members)
- [Add Members To A Group](/sdk/ios/group-add-members)
- [Kick Member From A Group](/sdk/ios/group-kick-member)
- [Change Member Scope](/sdk/ios/group-change-member-scope)
- [Transfer Group Ownership](/sdk/ios/transfer-group-ownership)

## Calling
- [Calling](/sdk/ios/calling-overview)

## AI
- [AI](/sdk/ios/ai-user-copilot-overview)
- [AI Agents](/sdk/ios/ai-agents)
- [Bots](/sdk/ios/ai-chatbots-overview)
- [AI Moderation](/sdk/ios/ai-moderation)

## Real-time, connection, and lifecycle
- [All Real Time Delegates (Listeners)](/sdk/ios/all-real-time-delegates-listeners)
- [Connection Status](/sdk/ios/connection-status)
- [Connection Behaviour](/sdk/ios/web-socket-connection-behaviour)
- [Managing Web Socket Connections Manually](/sdk/ios/managing-web-socket-connections-manually)

## Push notifications
- [Prepare Your App For Background Updates](/sdk/ios/prepare-your-app-for-background-updates)
- [Launch Chat Window On Tap Of Push Notification](/sdk/ios/launch-chat-window-on-tap-of-push-notification)
- [Launch Call Screen On Tap Of Push Notification](/sdk/ios/launch-call-screen-on-tap-of-push-notification)
- [Marking Delivered From Push Notification](/sdk/ios/marking-delivered-with-push-notification)
- [Increment App Icon Badge Count](/sdk/ios/increment-app-icon-badge-count)
- [Remove Delivered Notifications](/sdk/ios/remove-delivered-notifications)

## Platform extras
- [Extensions](/sdk/ios/extensions-overview)
- [Campaigns](/sdk/ios/campaigns)
- [Webhooks](/sdk/ios/webhooks-overview)
- [Publishing App On App Store](/sdk/ios/publishing-app-on-appstore)
20 changes: 10 additions & 10 deletions ui-kit/ios/ai-assistant-chat-history.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"sdkListeners": [],
"compositionExample": {
"description": "AIAssistanceChatHistory shows previous AI conversations for a user or group",
"components": ["CometChatAIAssistanceChatHistory", "CometChatMessages"],
"components": ["CometChatAIAssistanceChatHistory", "CometChatMessageList"],
"flow": "User opens AI history → selects conversation → views full AI chat"
}
}
Expand All @@ -56,7 +56,7 @@

<Steps>
<Step title="Install CometChat UI Kit">
Add to your Podfile:

Check warning on line 59 in ui-kit/ios/ai-assistant-chat-history.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/ai-assistant-chat-history.mdx#L59

Did you really mean 'Podfile'?
```ruby
pod 'CometChatUIKitSwift', '5.1.9'
```
Expand All @@ -71,13 +71,13 @@
```swift lines
import CometChatUIKitSwift

let uikitSettings = UIKitSettings()

Check warning on line 74 in ui-kit/ios/ai-assistant-chat-history.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/ai-assistant-chat-history.mdx#L74

Did you really mean 'uikitSettings'?
.set(appID: "YOUR_APP_ID")
.set(authKey: "YOUR_AUTH_KEY")
.set(region: "YOUR_REGION")
.build()

CometChatUIKit.init(uiKitSettings: uikitSettings) { result in

Check warning on line 80 in ui-kit/ios/ai-assistant-chat-history.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/ai-assistant-chat-history.mdx#L80

Did you really mean 'uikitSettings'?
switch result {
case .success:
CometChatUIKit.login(uid: "USER_ID") { _ in }
Expand Down Expand Up @@ -108,7 +108,7 @@
let chatHistory = CometChatAIAssistanceChatHistory()
chatHistory.user = user // Required!

navigationController?.pushViewController(chatHistory, animated: true)

Check warning on line 111 in ui-kit/ios/ai-assistant-chat-history.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/ai-assistant-chat-history.mdx#L111

Did you really mean 'chatHistory'?
}
}
```
Expand Down Expand Up @@ -258,7 +258,7 @@
// MARK: - Actions
private func startNewAIChat() {
// Option 1: Open messages view for new AI chat
let messagesVC = CometChatMessages()
let messagesVC = MessagesVC() // your own VC — see /ui-kit/ios/ios-conversation
messagesVC.user = user
navigationController?.pushViewController(messagesVC, animated: true)

Expand All @@ -284,7 +284,7 @@
}

private func continueChat(from message: BaseMessage) {
let messagesVC = CometChatMessages()
let messagesVC = MessagesVC() // your own VC — see /ui-kit/ios/ios-conversation
messagesVC.user = user
navigationController?.pushViewController(messagesVC, animated: true)
}
Expand Down Expand Up @@ -336,7 +336,7 @@
import UIKit
import CometChatUIKitSwift

class CustomEmptyView: UIView {

Check warning on line 339 in ui-kit/ios/ai-assistant-chat-history.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/ai-assistant-chat-history.mdx#L339

Did you really mean 'UIView'?

private let imageView: UIImageView = {
let iv = UIImageView()
Expand Down Expand Up @@ -416,13 +416,13 @@
}

// Usage
let chatHistory = CometChatAIAssistanceChatHistory()

Check warning on line 419 in ui-kit/ios/ai-assistant-chat-history.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/ai-assistant-chat-history.mdx#L419

Did you really mean 'chatHistory'?
chatHistory.user = user

let emptyView = CustomEmptyView()

Check warning on line 422 in ui-kit/ios/ai-assistant-chat-history.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/ai-assistant-chat-history.mdx#L422

Did you really mean 'emptyView'?
emptyView.startChatButton.addTarget(self, action: #selector(startNewChat), for: .touchUpInside)

chatHistory.set(emptyView: emptyView)

Check warning on line 425 in ui-kit/ios/ai-assistant-chat-history.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/ai-assistant-chat-history.mdx#L425

Did you really mean 'emptyView'?
```
</Tab>
</Tabs>
Expand Down Expand Up @@ -538,7 +538,7 @@
import CometChatSDK
import CometChatUIKitSwift

let chatHistory = CometChatAIAssistanceChatHistory()

Check warning on line 541 in ui-kit/ios/ai-assistant-chat-history.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/ai-assistant-chat-history.mdx#L541

Did you really mean 'chatHistory'?
chatHistory.user = user

// Create custom message request builder
Expand Down Expand Up @@ -589,7 +589,7 @@

private func setupTabs() {
// Chats Tab
let chatsVC = CometChatConversationsWithMessages()
let chatsVC = ChatListVC() // your own list + chat screen — see /ui-kit/ios/ios-tab-based-chat
let chatsNav = UINavigationController(rootViewController: chatsVC)
chatsNav.tabBarItem = UITabBarItem(
title: "Chats",
Expand All @@ -611,7 +611,7 @@
)

// Users Tab
let usersVC = CometChatUsersWithMessages()
let usersVC = ChatListVC() // your own list + chat screen — see /ui-kit/ios/ios-tab-based-chat
let usersNav = UINavigationController(rootViewController: usersVC)
usersNav.tabBarItem = UITabBarItem(
title: "Users",
Expand All @@ -623,7 +623,7 @@
}

private func startNewAIChat() {
let messagesVC = CometChatMessages()
let messagesVC = MessagesVC() // your own VC — see /ui-kit/ios/ios-conversation
messagesVC.user = currentUser

if let nav = selectedViewController as? UINavigationController {
Expand Down Expand Up @@ -683,7 +683,7 @@
chatHistory.user = user

chatHistory.onNewChatButtonClicked = { [weak self] selectedUser in
let messagesVC = CometChatMessages()
let messagesVC = MessagesVC() // your own VC — see /ui-kit/ios/ios-conversation
messagesVC.user = selectedUser
self?.navigationController?.pushViewController(messagesVC, animated: true)
}
Expand Down Expand Up @@ -762,7 +762,7 @@
chatHistory.user = currentUser

chatHistory.onNewChatButtonClicked = { [weak self] user in
let messagesVC = CometChatMessages()
let messagesVC = MessagesVC() // your own VC — see /ui-kit/ios/ios-conversation
messagesVC.user = user
self?.navigationController?.pushViewController(messagesVC, animated: true)
}
Expand All @@ -785,7 +785,7 @@

chatHistory.onMessageClicked = { [weak self] message in
// Open the messages view to continue the conversation
let messagesVC = CometChatMessages()
let messagesVC = MessagesVC() // your own VC — see /ui-kit/ios/ios-conversation
messagesVC.user = self?.user
self?.navigationController?.pushViewController(messagesVC, animated: true)
}
Expand Down Expand Up @@ -846,7 +846,7 @@
aiHistory.user = currentUser

aiHistory.onNewChatButtonClicked = { [weak self] user in
let messagesVC = CometChatMessages()
let messagesVC = MessagesVC() // your own VC — see /ui-kit/ios/ios-conversation
messagesVC.user = user
if let nav = self?.selectedViewController as? UINavigationController {
nav.pushViewController(messagesVC, animated: true)
Expand Down
18 changes: 9 additions & 9 deletions ui-kit/ios/ai-features.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
"category": "ai",
"features": [
{"name": "aiAgentChat", "description": "Chat with AI-powered assistants", "component": "CometChatMessages", "enabledByDefault": false},
{"name": "aiAgentChat", "description": "Chat with AI-powered assistants", "component": "CometChatMessageList", "enabledByDefault": false},
{"name": "chatHistory", "description": "Browse and resume previous AI sessions", "component": "CometChatAIAssistanceChatHistory", "enabledByDefault": false},
{"name": "streamingResponses", "description": "Real-time AI message streaming", "component": "CometChatMessageList", "enabledByDefault": false},
{"name": "suggestedMessages", "description": "AI-powered conversation starters and smart replies", "component": "CometChatMessageComposer", "enabledByDefault": false}
Expand All @@ -18,7 +18,7 @@
"location": "CometChat Dashboard → AI",
"features": ["Conversation Starter", "Smart Replies", "Conversation Summary"]
},
"relatedComponents": ["CometChatMessages", "CometChatAIAssistanceChatHistory", "CometChatMessageList", "CometChatMessageComposer"]
"relatedComponents": ["CometChatMessageList", "CometChatAIAssistanceChatHistory", "CometChatMessageList", "CometChatMessageComposer"]
}
```
</Accordion>
Expand Down Expand Up @@ -80,7 +80,7 @@

### Implementation

Conversation starters appear automatically in `CometChatMessages`:
Conversation starters appear automatically in `CometChatMessageList`:

<Tabs>
<Tab title="Swift">
Expand All @@ -94,7 +94,7 @@
func openChatWithUser(uid: String) {
CometChat.getUser(UID: uid) { [weak self] user in
DispatchQueue.main.async {
let messagesVC = CometChatMessages()
let messagesVC = MessagesVC() // your own VC — see /ui-kit/ios/ios-conversation
messagesVC.user = user

// Conversation starters appear automatically
Expand All @@ -102,7 +102,7 @@

self?.navigationController?.pushViewController(messagesVC, animated: true)
}
} onError: { error in

Check warning on line 105 in ui-kit/ios/ai-features.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/ai-features.mdx#L105

Did you really mean 'onError'?
print("Error: \(error?.errorDescription ?? "")")
}
}
Expand Down Expand Up @@ -142,7 +142,7 @@
class ChatViewController: UIViewController {

func openChat(with user: CometChat.User) {
let messagesVC = CometChatMessages()
let messagesVC = MessagesVC() // your own VC — see /ui-kit/ios/ios-conversation
messagesVC.user = user

// Smart replies appear automatically in the composer
Expand Down Expand Up @@ -186,7 +186,7 @@
class ChatViewController: UIViewController {

func openChat(with user: CometChat.User) {
let messagesVC = CometChatMessages()
let messagesVC = MessagesVC() // your own VC — see /ui-kit/ios/ios-conversation
messagesVC.user = user

// Conversation summary option appears in composer action sheet
Expand Down Expand Up @@ -400,7 +400,7 @@

private func setupTabs() {
// Chats - AI features (starters, smart replies, summary) work automatically
let chatsVC = CometChatConversationsWithMessages()
let chatsVC = ChatListVC() // your own list + chat screen — see /ui-kit/ios/ios-tab-based-chat
let chatsNav = UINavigationController(rootViewController: chatsVC)
chatsNav.tabBarItem = UITabBarItem(
title: "Chats",
Expand All @@ -418,7 +418,7 @@
)

// Users
let usersVC = CometChatUsersWithMessages()
let usersVC = ChatListVC() // your own list + chat screen — see /ui-kit/ios/ios-tab-based-chat
let usersNav = UINavigationController(rootViewController: usersVC)
usersNav.tabBarItem = UITabBarItem(
title: "Users",
Expand Down Expand Up @@ -491,7 +491,7 @@

chatHistory.onNewChatButtonClicked = { [weak self] in
// Start new AI chat
let messagesVC = CometChatMessages()
let messagesVC = MessagesVC() // your own VC — see /ui-kit/ios/ios-conversation
messagesVC.user = user
self?.navigationController?.pushViewController(messagesVC, animated: true)
}
Expand Down
10 changes: 5 additions & 5 deletions ui-kit/ios/call-buttons.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<Tab title="Swift">
```swift lines
let cometChatCallButton = CometChatCallButtons(width: 24, height: 24)
.set(onVoiceCallClick: { user, group in
.onVoiceCallClick = { user, group in
//Perform Your Action
})
```
Expand All @@ -109,7 +109,7 @@
<Tab title="Swift">
```swift lines
let cometChatCallButton = CometChatCallButtons(width: 24, height: 24)
.set(onVideoCallClick: { user, group in
.onVideoCallClick = { user, group in
//Perform Your Action

})
Expand Down Expand Up @@ -259,7 +259,7 @@
callButtonStyle.videoCallButtonBackground = UIColor(hex: "#EDEAFA")
callButtonStyle.videoCallIconTint = UIColor(hex: "#6852D6")

let callButton = CometChatCallButtons(width: 10, height: 10)

Check warning on line 262 in ui-kit/ios/call-buttons.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/call-buttons.mdx#L262

Did you really mean 'callButton'?
callButton.style = callButtonStyle
```

Expand Down Expand Up @@ -308,7 +308,7 @@
| set(group:Group) | Sets the Group object for CometChatCallButtons. | `.set(group:Group)` |
| set(outgoingCallConfiguration:) | Sets the configuration for outgoing calls. | `setOutgoingCallConfiguration(config)` |
| set(customSoundForCalls:) | Sets a custom sound for incoming and outgoing calls. | `set(customSoundForCalls: URL)` |
| set(callSettingBuilder:) | Function to build call settings based on call type and participants. | `.set(callSettingBuilder { callType, participants in ... })` |
| set(callSettingsBuilder:) | Function to build call settings based on call type and participants. | `.set(callSettingBuilder { callType, participants in ... })` |

### Advanced

Expand Down Expand Up @@ -345,7 +345,7 @@

**Example**

Let's say you want to change the style of the Outgoing Call subcomponent and, in addition, you only want to disable soundForCalls.

Check warning on line 348 in ui-kit/ios/call-buttons.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/call-buttons.mdx#L348

Did you really mean 'subcomponent'?

You can modify the style using the `OutgoingCallStyle` property, disable sound for calls using `.disable(soundForCalls: bool)` property.

Expand Down Expand Up @@ -374,7 +374,7 @@

```swift lines
let callButtons = CometChatCallButtons(width: 24, height: 24)
callButtons.set(controller: UIViewController) // Passing the controller is required

Check warning on line 377 in ui-kit/ios/call-buttons.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/call-buttons.mdx#L377

Did you really mean 'UIView'?
```

</Note>
Expand Down Expand Up @@ -476,7 +476,7 @@
```swift lines
class CustomMessageHeader: UIView {

private var callButtons: CometChatCallButtons!

Check warning on line 479 in ui-kit/ios/call-buttons.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/call-buttons.mdx#L479

Did you really mean 'callButtons'?

func configure(with user: User) {
callButtons = CometChatCallButtons(width: 24, height: 24)
Expand Down Expand Up @@ -516,7 +516,7 @@
```swift lines
let callButtons = CometChatCallButtons(width: 24, height: 24)
callButtons.set(user: user)
callButtons.set(onVoiceCallClick: { [weak self] user, group in
callButtons.onVoiceCallClick = { [weak self] user, group in
let alert = UIAlertController(
title: "Start Voice Call",
message: "Call \(user?.name ?? group?.name ?? "")?",
Expand Down Expand Up @@ -546,7 +546,7 @@
callButtons.set(controller: self)

// Custom call settings for group calls
callButtons.set(callSettingBuilder: { callType, participants in
callButtons.set(callSettingsBuilder: { callType, participants in
return CallSettingsBuilder()
.setDefaultLayout(true)
.setShowRecordingButton(true)
Expand Down
Loading