Skip to main content

Documentation Index

Fetch the complete documentation index at: https://cometchat-22654f5b-docs-android-v6-beta2.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

import CometChatSDK

// 1. Initialize (once at app startup)
let appSettings = AppSettings.AppSettingsBuilder()
  .setRegion(region: "APP_REGION") // e.g. "us", "eu", "in"
  .subscribePresenceForAllUsers()
  .autoEstablishSocketConnection(true)
  .build()

CometChat.init(appId: "APP_ID", appSettings: appSettings, onSuccess: { _ in
  print("CometChat initialized")
}, onError: { error in
  print("Init failed: \(error.errorDescription)")
})

// 2. Login (check session first)
if CometChat.getLoggedInUser() == nil {
  CometChat.login(UID: "cometchat-uid-1", authKey: "AUTH_KEY", onSuccess: { user in
    print("Logged in: \(user.stringValue())")
  }, onError: { error in
    print("Login failed: \(error.errorDescription)")
  })
}
Credentials: App ID, Region, Auth Key from CometChat Dashboard Test UIDs: cometchat-uid-1 through cometchat-uid-5
The CometChat iOS SDK lets you add real-time messaging, voice, and video calling to any iOS application — Swift or Objective-C.

Requirements

RequirementMinimum Version
Xcode12
iOS11

Getting Started

1

Get your credentials

Sign up for CometChat and create an app. Note your App ID, Region, and Auth Key from the Dashboard.
2

Install and initialize

Add the SDK via CocoaPods or Swift Package Manager and initialize it with your credentials. See Setup.
3

Authenticate users

Log in users with Auth Key (development) or Auth Token (production). See Authentication.
4

Start building

Send your first message, make a call, or manage users and groups.

Features

Messaging

1:1 and group chat, threads, reactions, typing indicators, read receipts, and file sharing.

Voice & Video Calling

Ringing flows, direct call sessions, standalone calling, recording, and screen sharing.

Users

Create, retrieve, and manage users. Track online/offline presence and block/unblock users.

Groups

Public, private, and password-protected groups with member management, roles, and ownership transfer.

Sample Apps

Explore working examples with full source code:

Swift

Swift sample app

Objective-C

Objective-C sample app

UI Kits

Skip the UI work — use pre-built, customizable components:

iOS UI Kit

iOS UI Kit

Resources

Key Concepts

UIDs, GUIDs, auth tokens, and core SDK concepts

Message Structure

Message categories, types, and hierarchy

Changelog

Latest SDK version and release notes

Upgrading from V3

Migration guide for V3 users