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

# Integration

> Integration — CometChat documentation.

The **CometChatProCalls** is developed to keep developers in mind and aims to reduce development efforts significantly. Let's start to integrate Calls Kit into your project.

***

## Before you begin

Before installing **CometChatProCalls for iOS**, you need to create a CometChat application on the CometChatPro Dashboard, which comprises everything required in a chat service including users, groups, calls & messages. You will need the `App ID` , `AuthKey`, `Region` of your CometChat application when initializing the SDK.

**i. Register on CometChat 🧑💻**

* To install **CometChatProCalls for iOS**, you need to first register on **CometChat Dashboard**. [Click here to sign up](https://app.cometchat.com/login).

**ii. Get Your Application Keys 🔑**

* Create a **new app**
* Head over to the **QuickStart** or **API & Auth Keys section** and note the **App ID**, **Auth Key**, and **Region**.

<Tip>
  Each CometChat application can be integrated with a single client app. Within the same application, users can communicate with each other across all platforms, whether they are on mobile devices or on the web.
</Tip>

***

## Prerequisites

The minimum requirements for **CometChatProCalls for iOS** are:

* `macOS`
* `Xcode`
* `iOS 13.0 and later`
* `Swift 5.0+`

***

## Get Started

You can start building a modern calling experience in your app by installing Pluto UIKit. This developer kit is an add-on feature to CometChatPro iOS SDK so installing it will also install the core Chat SDK.

***

### Step 1 : Create a project

To get started, open `Xcode` and create a new project.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-content-webhooks/kibZL8uJM6A1yelM/images/237ccee2-q6obkhj3ho4tyjyzw7uw49wszuq3tsrihm0gg59nitji64xlzk6df6slj1yu1uad-47b83cd045a26dfb66514a437cef7f3f.png?fit=max&auto=format&n=kibZL8uJM6A1yelM&q=85&s=e2452ec14c46cb4ab9adb0458c7ceadc" width="734" height="523" data-path="images/237ccee2-q6obkhj3ho4tyjyzw7uw49wszuq3tsrihm0gg59nitji64xlzk6df6slj1yu1uad-47b83cd045a26dfb66514a437cef7f3f.png" />
</Frame>

#### Enter name, identifier and proceed.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-content-webhooks/P-fnFPeZIhsNyk74/images/c0b19786-9yew8luav2m0fotkz1jl5umdws0wp0m9wm5svbfk3fljb6htvs1sy19utpkhboio-cc9b866792207adec092fe89bd02dfe6.png?fit=max&auto=format&n=P-fnFPeZIhsNyk74&q=85&s=b0f1645db2969de3191d456cfdfb5d0e" width="734" height="523" data-path="images/c0b19786-9yew8luav2m0fotkz1jl5umdws0wp0m9wm5svbfk3fljb6htvs1sy19utpkhboio-cc9b866792207adec092fe89bd02dfe6.png" />
</Frame>

***

### Step 2 : Install CometChatProCalls Kit

You can install **CometChatProCalls for iOS** through **Swift Package Manager or Cocoapods**

### CocoaPods

We recommend using [CocoaPods](https://cocoapods.org/), as they are the most advanced way of managing iOS project dependencies. Open a terminal window, move to your project directory, and then create a `Podfile` by running the following command.

<Tabs>
  <Tab title="Swift">
    ```bash theme={null}
    $ pod init
    ```
  </Tab>
</Tabs>

Add the following lines to the Podfile.

<Tabs>
  <Tab title="Swift">
    ```ruby theme={null}
    platform :ios, '11.0'
    use_frameworks!

    target 'YourApp' do
      pod 'CometChatPro', '3.0.917
      pod 'CometChatCalls', '3.0.2'
    end
    ```
  </Tab>
</Tabs>

And then install the `CometChatCalls` framework through CocoaPods.

<Tabs>
  <Tab title="Swift">
    ```bash theme={null}
    $ pod install
    ```
  </Tab>
</Tabs>

If you're facing any issues while installing pods then use the below command.

<Tabs>
  <Tab title="Swift">
    ```bash theme={null}
    $ pod install --repo-update
    ```
  </Tab>
</Tabs>

Always get the latest version of `CometChatCalls` by command.

<Tabs>
  <Tab title="Swift">
    ```bash theme={null}
    $ pod update CometChatCalls
    ```
  </Tab>
</Tabs>

<Note>
  CometChatCalls version `3.0.0` is compatible with `3.0.914` version of CometChatPro
</Note>

### Swift Package Manager

1. Go to your Swift Package Manager's **File** tab and select **Add Packages**.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-content-webhooks/CPpOwQ6tJe7YNAEX/images/e100a847-fhfn5g9darizpnc6798cnwds8h11w4khuv5xnnrui3vxcn4jd5opgmas2hw0o8a1-bd9e70be7840d56e71e6f63358afc019.png?fit=max&auto=format&n=CPpOwQ6tJe7YNAEX&q=85&s=a47770ea02ef80b2720877e87d51e504" width="690" height="382" data-path="images/e100a847-fhfn5g9darizpnc6798cnwds8h11w4khuv5xnnrui3vxcn4jd5opgmas2hw0o8a1-bd9e70be7840d56e71e6f63358afc019.png" />
</Frame>

2. Add `CometChatProCalls` into your Package Repository as below:

<Tabs>
  <Tab title="bash">
    ```bash theme={null}
    https://github.com/cometchat-pro/ios-calls-sdk.git
    ```
  </Tab>
</Tabs>

3. To add the package, select Version Rules, enter Up to Exact Version, **`3.0.0`**, and click Next.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-content-webhooks/0zf0AzyXRy6UbTAi/images/f041182c-5flnsp9djy87b5b6v6miu6u9i6aaedozk7j69pz1r3k4t7d8tv48eqt4vpihutqn-58d01c7c4c9be85298f89ccd1bde4103.png?fit=max&auto=format&n=0zf0AzyXRy6UbTAi&q=85&s=58b5d05e7cef546d0111383ce3ba5595" width="1181" height="608" data-path="images/f041182c-5flnsp9djy87b5b6v6miu6u9i6aaedozk7j69pz1r3k4t7d8tv48eqt4vpihutqn-58d01c7c4c9be85298f89ccd1bde4103.png" />
</Frame>

4. Once, the package is added it will look like this.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-content-webhooks/CPpOwQ6tJe7YNAEX/images/dfd9ce66-tjygs9nz1ehz79h9w19h8xntw2phudfsaoqy4sayh6nxu6d45lxdxhsl03ir588m-1e77d6fbda523106bf050c2ec1a0466c.png?fit=max&auto=format&n=CPpOwQ6tJe7YNAEX&q=85&s=06e5ee0e68d72f245289b0e0aaa8ecf7" width="440" height="102" data-path="images/dfd9ce66-tjygs9nz1ehz79h9w19h8xntw2phudfsaoqy4sayh6nxu6d45lxdxhsl03ir588m-1e77d6fbda523106bf050c2ec1a0466c.png" />
</Frame>

### **Cocoa Pods**

Go to root directory. (Where the .xcodeproj reside.) and perform these commands.

<Tip>
  Pod installation

  1. pod init
  2. open -a Xcode Podfile

  Your pod file will open in the text editor. Add your project dependency. 3. pod 'CometChatProCalls', '3.0.0-alpha7' 4. For M1 Mac - arch -x86\_64 pod install or For Intel Mac - pod install
</Tip>

***

## Initialize CometChatProCalls

### 1. CallsAppSettings

The `init()` method takes `CallsAppSettings` as a parameter and user can set it by `CallsAppSettingBuilder`. User should be first set the `CallsAppSettings`.

CallsAppSettings has 3 parameters

1. `appId` it is mandatory parameter.
2. `region` It is mandatory parameter.
3. `host` It is optional parameter.

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

    let appID = "APP_ID"
    let region = "REGION"
    let host = "HOST"
    let callSettings: CometChatProCalls.CallSettings?

    let callAppSettings = CallAppSettingsBuilder()
                .setAppId(appId)
                .setRegion(region)
                .setHost(host)
                .build()
    ```
  </Tab>

  <Tab title="Objective C">
    ```objc theme={null}
    @interface ViewController : UIViewController

    @property (nonatomic, strong) CallSetting *callSettings;
    @property (nonatomic, strong) NSString *appId;
    @property (nonatomic, strong) NSString *region;
    @property (nonatomic, strong) NSString *host;

    @end

    @implementation ViewController


    -(void)setupCallsSetting {
        
       self.callAppSettings = [[[[[CallAppSettingsBuilder new]
                                 setAppId:self.appId]
                                 setRegion:self.region]
                                setHost:self.host]
                                build];
    }
    @end
    ```
  </Tab>
</Tabs>

<Warning>
  Make sure you replace the **appId** with your CometChat *appId* and *region* with your app region in the above code.
</Warning>

### 2. Init() Method

From the above CallAppSettings, pass the settings to the init() method.

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    guard let callAppSettings = callAppSettings else { return }

    CometChatCalls.init(callsAppSettings: callAppSettings) { success in
        print("CometChatCalls init success: \(success)")
    } onError: { error in
        print("CometChatCalls init error: \(String(describing: error?.errorDescription))")
    }
    ```
  </Tab>
</Tabs>
