Skip to main content
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:
platform :ios, '13.0'
use_frameworks!

target 'YourApp' do
  pod 'CometChatCallsSDK', '~> 5.0.0'
end
Then run:
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:
<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>
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.

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:
ParameterTypeRequiredDescription
appIdStringYesYour CometChat App ID
regionStringYesYour app region (us or eu)
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 ?? "")")
})
ParameterDescription
callsAppSettingsConfiguration object with App ID and Region
onSuccessClosure called on successful initialization
onErrorClosure called if initialization fails