> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-rn-guide-message-privately.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# iOS SDK

> Add real-time chat, voice, and video to iOS apps with the CometChat SDK, including users, groups, messages, and calls.

<Accordion title="AI Integration Quick Reference">
  ```swift theme={null}
  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](https://app.cometchat.com)
  **Test UIDs:** `cometchat-uid-1` through `cometchat-uid-5`
</Accordion>

The CometChat iOS SDK lets you add real-time messaging, voice, and video calling to any iOS application — Swift or Objective-C.

## Requirements

| Requirement | Minimum Version |
| ----------- | --------------- |
| Xcode       | 12              |
| iOS         | 11              |

## Getting Started

<Steps>
  <Step title="Get your credentials">
    [Sign up for CometChat](https://app.cometchat.com) and create an app. Note your App ID, Region, and Auth Key from the Dashboard.
  </Step>

  <Step title="Install and initialize">
    Add the SDK via CocoaPods or Swift Package Manager and initialize it with your credentials. See [Setup](/sdk/ios/setup).
  </Step>

  <Step title="Authenticate users">
    Log in users with Auth Key (development) or Auth Token (production). See [Authentication](/sdk/ios/authentication-overview).
  </Step>

  <Step title="Start building">
    Send your first message, make a call, or manage users and groups.
  </Step>
</Steps>

## Features

<CardGroup cols={2}>
  <Card title="Messaging" icon="comments" href="/sdk/ios/send-message">
    1:1 and group chat, threads, reactions, typing indicators, read receipts, and file sharing.
  </Card>

  <Card title="Voice & Video Calling" icon="phone" href="/sdk/ios/default-calling">
    Ringing flows, direct call sessions, standalone calling, recording, and screen sharing.
  </Card>

  <Card title="Users" icon="user" href="/sdk/ios/retrieve-users">
    Create, retrieve, and manage users. Track online/offline presence and block/unblock users.
  </Card>

  <Card title="Groups" icon="users" href="/sdk/ios/groups-overview">
    Public, private, and password-protected groups with member management, roles, and ownership transfer.
  </Card>
</CardGroup>

## Sample Apps

Explore working examples with full source code:

<CardGroup cols={2}>
  <Card title="Swift" icon="swift" href="https://github.com/cometchat/cometchat-chat-sample-app-ios-swift/archive/v4.zip">
    Swift sample app
  </Card>

  <Card title="Objective-C" icon="apple" href="https://github.com/cometchat-pro/ios-objective-c-chat-app/archive/master.zip">
    Objective-C sample app
  </Card>
</CardGroup>

## UI Kits

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

<CardGroup cols={2}>
  <Card title="iOS UI Kit" icon="apple" href="/ui-kit/ios/overview">
    iOS UI Kit
  </Card>
</CardGroup>

## Resources

<CardGroup cols={2}>
  <Card title="Key Concepts" icon="lightbulb" href="/sdk/ios/key-concepts">
    UIDs, GUIDs, auth tokens, and core SDK concepts
  </Card>

  <Card title="Message Structure" icon="sitemap" href="/sdk/ios/message-structure-and-hierarchy">
    Message categories, types, and hierarchy
  </Card>

  <Card title="Changelog" icon="clock-rotate-left" href="/sdk/ios/changelog">
    Latest SDK version and release notes
  </Card>

  <Card title="Upgrading from V3" icon="arrow-up" href="/sdk/ios/upgrading-from-v3-to-v4">
    Migration guide for V3 users
  </Card>
</CardGroup>
