> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-angular-v5-docs-update.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-angular-v5-docs-update/1AfY8AvJMqtx4lQu/images/237ccee2-q6obkhj3ho4tyjyzw7uw49wszuq3tsrihm0gg59nitji64xlzk6df6slj1yu1uad-47b83cd045a26dfb66514a437cef7f3f.png?fit=max&auto=format&n=1AfY8AvJMqtx4lQu&q=85&s=3c301b9735948a23809d8b17f21e6b97" 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-angular-v5-docs-update/ZgtHsaNQApHuht0z/images/c0b19786-9yew8luav2m0fotkz1jl5umdws0wp0m9wm5svbfk3fljb6htvs1sy19utpkhboio-cc9b866792207adec092fe89bd02dfe6.png?fit=max&auto=format&n=ZgtHsaNQApHuht0z&q=85&s=18cebe9bb5dc5da0c13b4d074d07db71" 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-angular-v5-docs-update/7FrH1XBoyJH8fE7_/images/e100a847-fhfn5g9darizpnc6798cnwds8h11w4khuv5xnnrui3vxcn4jd5opgmas2hw0o8a1-bd9e70be7840d56e71e6f63358afc019.png?fit=max&auto=format&n=7FrH1XBoyJH8fE7_&q=85&s=289fc77e69f359b859859edba2d782c0" 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-angular-v5-docs-update/H2Jrd_-HLEdrybSX/images/f041182c-5flnsp9djy87b5b6v6miu6u9i6aaedozk7j69pz1r3k4t7d8tv48eqt4vpihutqn-58d01c7c4c9be85298f89ccd1bde4103.png?fit=max&auto=format&n=H2Jrd_-HLEdrybSX&q=85&s=4c950a30cca620a28ae743d2c83637a0" 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-angular-v5-docs-update/7FrH1XBoyJH8fE7_/images/dfd9ce66-tjygs9nz1ehz79h9w19h8xntw2phudfsaoqy4sayh6nxu6d45lxdxhsl03ir588m-1e77d6fbda523106bf050c2ec1a0466c.png?fit=max&auto=format&n=7FrH1XBoyJH8fE7_&q=85&s=1f6f3ca6c06e107e78b89405016edba4" 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>
