Skip to main content

Overview

This guide adds voice and video calling to an app that already uses the iOS UI Kit v6.
Complete Getting Started first — the Kit installed, initialised and a user logged in.

The Calls SDK Comes With the Kit

There is no second package to add. The Kit’s package declares the CometChat Calls SDK (CometChatCallsSDK) itself, so it resolves with https://github.com/cometchat/cometchat-uikit-ios.git and the call screens are compiled in:
Package.swift
Building the Kit with the environment variable COMETCHAT_UIKIT_NO_CALLS=1 leaves the Calls SDK out: the package’s manifest reads it when it is resolved, so it must be set in the environment of the command that resolves and builds (swift build, xcodebuild). Without the Calls SDK the Kit has no call screens, and the call buttons show only where your app handles the tap itself.

Turn Calling On

Calling is off by default. Pass enableCalling: true when you initialise:
With the flag on, initialize also initialises the Calls SDK, and every login logs it in. A Calls SDK failure is logged and leaves calling off — initialize and login themselves do not fail. A chat session restored from an earlier launch logs the Calls SDK in too, so turning calling on in an app whose users are already logged in needs no re-login. Add the two usage descriptions a call needs to your app’s Info.plist:
Info.plist

Show the Call Buttons

Once calling is on, the voice and video buttons appear in the Message Header:
The SwiftUI header hides them by default. Show them:
A tap places the call and shows it — a 1:1 call rings on Outgoing Call, a group tap joins a meeting on Ongoing Call.

Install a Call Presenter

Without a presenter, each component presents the calls it starts. With one, every call — from the call buttons, the call log, a meeting bubble’s Join, or a call answered from CallKit — appears in one place, and an answered call has somewhere to show:
Apply it once, at your app’s root:

Incoming Calls

The Kit has no in-app incoming-call screen. An incoming call rings on CallKit — on the lock screen, in the background or with the app killed — through your app’s VoIP push integration, which hands the answered call to the Kit. See Call Features.