Skip to main content
Faster Integration with UI KitsIf 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 IntegrationUse this Calls SDK directly only if you need custom call UI or advanced control.
This guide walks you through installing the CometChat Calls SDK and initializing it in your iOS application.

Add the CometChat Dependency

The Calls SDK 5.1 is distributed with Swift Package Manager. It needs iOS 15.1 or later.
  1. In Xcode, go to File > Add Package Dependencies
  2. Enter the repository URL: https://github.com/cometchat/calls-sdk-ios
  3. Select Up to Next Major Version from 5.1.0 and add the CometChatCallsSDK product to your target
The Calls SDK’s API is Swift only: it doesn’t ship an Objective-C interface. An Objective-C app calls it from Swift code in the same target. The Push Notifications SDK, which rings calls, supports Objective-C.
Ringing users? Incoming calls ring through the Push Notifications SDK 2.0: add its Core and Calls products (CometChatPushNotificationsSwift and CometChatPushNotificationsCalls) as well, and follow Push Ringing. The Calls SDK alone can start, join and end calls, but it cannot ring a device that is not running your app.

Add Permissions

Add the required permissions to your Info.plist:
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. Add both strings even if your app only makes audio calls: the Calls SDK links the camera.
Request camera and microphone access before starting or joining a call. When a call is answered from the Push SDK’s CallKit ring, the Push SDK asks for them after Answer (on a locked phone, once the user unlocks); a denied microphone joins muted.

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 (required for ringing: without it PushKit delivers no VoIP push)
Ringing also needs the Push Notifications capability. PushKit and CallKit only work on a physical device.

Declare a Window on Your AppDelegate

The Calls SDK reads window from your app delegate when the device orientation changes. Xcode’s default scene-based template puts window only on the SceneDelegate, so without it the app crashes with -[AppDelegate window]: unrecognized selector sent to instance when a call starts, typically right after the camera permission prompt. Declare the property on your AppDelegate, even if you set the window up in your SceneDelegate:
The property can stay nil. The SDK only needs your AppDelegate to respond to window.

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:
Initialize once, at launch. A later initialization replaces the app ID and region but does not log the user out: the stored user and auth token stay, and belong to the first app. To switch to another app ID, call CometChatCalls.logout first, then initialize with the new app ID and log in again. When a VoIP push starts your app, the Push SDK may initialize the Calls SDK with the appId and region from its own configuration before your code runs; your own initialization with the same values is harmless.