> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Calling Integration

> Turn on voice and video calling in the CometChat iOS UI Kit v6, in SwiftUI or UIKit: the Calls SDK comes with the Kit, one flag turns it on, and a presenter shows the calls.

## Overview

This guide adds voice and video calling to an app that already uses the iOS UI Kit v6.

> [!NOTE]
>
> Complete [Getting Started](https://www.cometchat.com/docs/ui-kit/ios/v6/getting-started.md) 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:

```swift Package.swift theme={null}
dependencies: [
    .package(url: "https://github.com/cometchat/cometchat-uikit-ios.git", from: "6.0.0-beta.1"),
],
```

> [!NOTE]
>
> 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:

> [tab] SwiftUI
>
> ```swift theme={null}
> try await CometChatSession.initialize(appID: appID, region: region, enableCalling: true)
> try await CometChatSession.login(uid: uid, authKey: authKey)
> ```

> [tab] UIKit
>
> ```swift theme={null}
> import CometChatUIKit
>
> try await CometChatSession.initialize(appID: appID, region: region, enableCalling: true)
> try await CometChatSession.login(uid: uid, authKey: authKey)
> ```

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`:

```xml Info.plist theme={null}
<key>NSMicrophoneUsageDescription</key>
<string>Talk in voice and video calls.</string>
<key>NSCameraUsageDescription</key>
<string>Show your video in video calls.</string>
```

## Show the Call Buttons

Once calling is on, the voice and video buttons appear in the
[Message Header](https://www.cometchat.com/docs/ui-kit/ios/v6/message-header.md):

> [tab] SwiftUI
>
> The SwiftUI header hides them by default. Show them:
>
> ```swift theme={null}
> CometChatMessageHeader(user: user, hideVideoCallButton: false, hideVoiceCallButton: false)
> ```

> [tab] UIKit
>
> `CometChatMessageHeader` shows them as soon as calling is on — no code needed. `hideVoiceCallButton` and `hideVideoCallButton` turn them off.

A tap places the call and shows it — a 1:1 call rings on
[Outgoing Call](https://www.cometchat.com/docs/ui-kit/ios/v6/outgoing-call.md), a group tap joins a meeting on
[Ongoing Call](https://www.cometchat.com/docs/ui-kit/ios/v6/ongoing-call.md).

## 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:

> [tab] SwiftUI
>
> Apply it once, at your app's root:
>
> ```swift theme={null}
> struct RootView: View {
>     var body: some View {
>         MyAppRoot()
>             .cometChatCallPresenter()
>     }
> }
> ```

> [tab] UIKit
>
> Start it once, at launch. It presents from the active scene's top-most view controller:
>
> ```swift theme={null}
> CometChatCallPresenter.shared.start()
> ```

## 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](https://www.cometchat.com/docs/ui-kit/ios/v6/call-features.md#incoming-calls).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.