> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup

> CometChat Calling SDK v5 - Setup for iOS

<Info>
  **Faster Integration with UI Kits**

  If you're using CometChat UI Kits, voice and video calling can be quickly integrated:

  * Incoming & outgoing call screens
  * Call buttons with one-tap calling
  * Call logs with history

  👉 [iOS UI Kit Calling Integration](/ui-kit/ios/calling-integration)

  Use this Calls SDK directly only if you need custom call UI or advanced control.
</Info>

This guide walks you through installing the CometChat Calls SDK and initializing it in your iOS application.

## Add the CometChat Dependency

### Using CocoaPods

Add the CometChat Calls SDK to your `Podfile`:

```ruby theme={null}
platform :ios, '16.0'
use_frameworks!

target 'YourApp' do
  pod 'CometChatCallsSDK', '~> 5.0.0'
end
```

Then run:

```bash theme={null}
pod install
```

### Using Swift Package Manager

1. In Xcode, go to **File > Add Package Dependencies**
2. Enter the repository URL: `https://github.com/cometchat/cometchat-calls-sdk-ios`
3. Select the version and add to your target

## Add Permissions

Add the required permissions to your `Info.plist`:

```xml theme={null}
<key>NSCameraUsageDescription</key>
<string>Camera access is required for video calls</string>
<key>NSMicrophoneUsageDescription</key>
<string>Microphone access is required for voice and video calls</string>
```

<Note>
  iOS requires you to provide a description for why your app needs camera and microphone access. These descriptions are shown to users when requesting permissions.
</Note>

## Enable Background Modes

For calls to continue when the app is in the background, enable the following background modes in your project's **Signing & Capabilities**:

1. Select your target in Xcode
2. Go to **Signing & Capabilities**
3. Click **+ Capability** and add **Background Modes**
4. Enable:
   * **Audio, AirPlay, and Picture in Picture**
   * **Voice over IP** (if using VoIP push notifications)

## Initialize CometChat Calls

The `init()` method initializes the SDK with your app credentials. Call this method once when your application starts, typically in your `AppDelegate` or app entry point.

### CallAppSettings

The `CallAppSettings` class configures the SDK initialization:

| Parameter | Type   | Required | Description                    |
| --------- | ------ | -------- | ------------------------------ |
| `appId`   | String | Yes      | Your CometChat App ID          |
| `region`  | String | Yes      | Your app region (`us` or `eu`) |

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    import CometChatCallsSDK

    let appId = "APP_ID" // Replace with your App ID
    let region = "REGION" // Replace with your Region ("us" or "eu")

    let callAppSettings = CallAppSettingsBuilder()
        .setAppId(appId)
        .setRegion(region)
        .build()

    CometChatCalls(callsAppSettings: callAppSettings, onSuccess: { message in
        print("CometChat Calls SDK initialized successfully")
    }, onError: { error in
        print("CometChat Calls SDK initialization failed: \(error?.errorDescription ?? "")")
    })
    ```
  </Tab>

  <Tab title="Objective-C">
    ```objectivec theme={null}
    @import CometChatCallsSDK;

    NSString *appId = @"APP_ID"; // Replace with your App ID
    NSString *region = @"REGION"; // Replace with your Region ("us" or "eu")

    CallAppSettings *callAppSettings = [[[CallAppSettingsBuilder alloc] init]
        setAppId:appId]
        setRegion:region]
        build];

    [[CometChatCalls alloc] initWithCallsAppSettings:callAppSettings 
        onSuccess:^(NSString * message) {
            NSLog(@"CometChat Calls SDK initialized successfully");
        } 
        onError:^(CometChatCallException * error) {
            NSLog(@"CometChat Calls SDK initialization failed: %@", error.errorDescription);
        }];
    ```
  </Tab>
</Tabs>

| Parameter          | Description                                 |
| ------------------ | ------------------------------------------- |
| `callsAppSettings` | Configuration object with App ID and Region |
| `onSuccess`        | Closure called on successful initialization |
| `onError`          | Closure called if initialization fails      |
