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

# Call

> One-to-one and group voice and video calling in the CometChat iOS UI Kit v6: the call components, how a call is shown, incoming calls through CallKit, and the call events.

> [accordion] AI Integration Quick Reference
>
> | Field | Value |
> | - | - |
> | SwiftUI | `CometChatSwiftUI` — the Calls SDK comes with the Kit's package |
> | UIKit | `CometChatUIKit` — the Calls SDK comes with the Kit's package |
> | Required setup | `CometChatSession.initialize(appID:region:enableCalling: true)` then `CometChatSession.login(…)` |
> | Call features | Call Buttons, Outgoing Call, Ongoing Call, Call Logs, Call Log Details |
> | Key components | `CometChatCallButtons`, `CometChatOutgoingCall`, `CometChatOngoingCall`, `CometChatCallLogs`, `CometChatCallLogDetails` |
> | Presenters | `.cometChatCallPresenter()` (SwiftUI) · `CometChatCallPresenter.shared.start()` (UIKit) |
> | Incoming calls | No in-app incoming-call screen — CallKit rings, through your VoIP push integration and `CallCoordinator`'s hooks |
> | Related | [Calling Integration](https://www.cometchat.com/docs/ui-kit/ios/v6/calling-integration.md), [Call Log Details Guide](https://www.cometchat.com/docs/ui-kit/ios/v6/guide-call-log-details.md) |

CometChat's calling adds one-to-one and group voice and video calls to your app. This page is
an overview of how the iOS UI Kit v6 implements them, in both toolkits.

## Integration

First integrate the Kit — see [Getting Started](https://www.cometchat.com/docs/ui-kit/ios/v6/getting-started.md). Then:

### Step 1: Turn Calling On

The Calls SDK is already part of the Kit's package; there is nothing to add. Turn calling on
when you initialise:

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

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

[Calling Integration](https://www.cometchat.com/docs/ui-kit/ios/v6/calling-integration.md) has the details — the `Info.plist`
keys, and how to build without the Calls SDK.

### Step 2: Verify the Call Buttons Appear

The [Message Header](https://www.cometchat.com/docs/ui-kit/ios/v6/message-header.md) shows `CometChatCallButtons` once
calling is on — in UIKit by itself; in SwiftUI with `hideVoiceCallButton: false` and
`hideVideoCallButton: false`.

### Step 3: Install a Call Presenter

A presenter shows every call the Kit starts or answers, in one place:

> [tab] SwiftUI
>
> ```swift theme={null}
> MyAppRoot()
>     .cometChatCallPresenter()
> ```

> [tab] UIKit
>
> ```swift theme={null}
> CometChatCallPresenter.shared.start()
> ```

Without one, each component presents the calls it starts itself. Either way a call never gets
two screens: while a presenter is installed, the components present nothing, and a call screen
of your own keeps both presenters away from its call.

## How a Call Is Shown

| You tap | The Kit | Screen |
| - | - | - |
| voice or video, for a user | places a 1:1 call, rings for up to 45 s | [Outgoing Call](https://www.cometchat.com/docs/ui-kit/ios/v6/outgoing-call.md), which becomes the call when answered |
| voice or video, for a group | sends a `meeting` message to the group and joins it | [Ongoing Call](https://www.cometchat.com/docs/ui-kit/ios/v6/ongoing-call.md) |
| a meeting bubble's **Join** | joins that meeting | Ongoing Call |
| a call log's call-back button | rings the other party again (1:1 logs only) | Outgoing Call |

One call is up at a time. `CallCoordinator.shared` holds it: `outgoing` while a placed call
rings, `ongoing` once it is joined, and `activeCall` for the call in progress.

Group calls do not ring — every group tap is a meeting the members join from its bubble.

## Incoming Calls

The Kit has **no in-app incoming-call screen**. An
incoming call rings on CallKit — the system call screen, locked, in the background or with the
app killed — through your app's VoIP push integration (PushKit and CallKit). The Kit exposes
public hooks on `CallCoordinator` in `CometChatCore` for it, and joins the call when the user
answers. An app without a push integration shows no incoming calls.

Your push integration calls the Kit at two moments:

```swift theme={null}
// The user answered on CallKit: the Kit joins at once, before any screen exists.
// Return the result to your push SDK; `false` would end the call.
let taken = CallCoordinator.shared.answeredFromPush(sessionID: "SESSION_ID", kind: .video,
                                                    title: "Alice Kim", isPeerCall: true)

// CallKit ended the call — its end button, or the other side hung up.
CallCoordinator.shared.end(sessionID: "SESSION_ID")
```

And it hears the Kit through a `CallLifecycleObserver`, to register its push tokens and to
report the calls the Kit places to CallKit:

```swift theme={null}
final class MyCallPushObserver: CallLifecycleObserver {
    /// After a login, and at initialize for a restored session: register your VoIP token.
    func callsSessionDidLogIn() async {}
    /// Before the logout: unregister the token, and finish. The logout waits — up to 10 s.
    func callsSessionWillLogOut() async {}
    /// An outgoing 1:1 call is ringing: report it to CallKit as outgoing.
    func callDidPlace(_ call: ActiveCall) {}
    /// The call joined: report it connected — unless `call.origin == .answeredPush`.
    func callDidJoin(_ call: ActiveCall) {}
    /// The call ended, for any reason, once: report it ended.
    func callDidEnd(_ call: ActiveCall) {}
}
```

```swift theme={null}
let observer = MyCallPushObserver()
CallCoordinator.shared.addObserver(observer)   // held weakly — keep `observer` alive
```

For one call the order is `callDidPlace` (outgoing calls only), `callDidJoin`, then exactly
one `callDidEnd` — also for a call that ended before it was answered. A meeting is never
placed: report it outgoing and connected at its `callDidJoin`. Keep a presenter installed so
an answered call has a screen when the app comes to the front.

## Call Components

### Call Buttons

`CometChatCallButtons` — voice and video buttons for a user or a group, used by the message
header. [Learn more about Call Buttons →](https://www.cometchat.com/docs/ui-kit/ios/v6/call-buttons.md)

### Outgoing Call

`CometChatOutgoingCall` — the ringing screen: the callee, "Calling…" then "Ringing…", and the
end button; it becomes the call when answered.
[Learn more about Outgoing Call →](https://www.cometchat.com/docs/ui-kit/ios/v6/outgoing-call.md)

### Ongoing Call

`CometChatOngoingCall` — the call itself, drawn by the Calls SDK, with the Kit's connecting and
failure states. [Learn more about Ongoing Call →](https://www.cometchat.com/docs/ui-kit/ios/v6/ongoing-call.md)

### Call Logs

`CometChatCallLogs` — the user's call history, with a call-back button on every row.
[Learn more about Call Logs →](https://www.cometchat.com/docs/ui-kit/ios/v6/call-logs.md)

### Call Log Details

`CometChatCallLogDetails` — one call's participants, recordings and history with that user or
group. [Learn more about Call Log Details →](https://www.cometchat.com/docs/ui-kit/ios/v6/call-log-details.md), or follow
the [Call Log Details guide](https://www.cometchat.com/docs/ui-kit/ios/v6/guide-call-log-details.md).

## Call Events

The Kit emits `outgoingCall`, `callAccepted`, `callRejected` and `callEnded`:

> [tab] SwiftUI
>
> ```swift theme={null}
> MyScreen()
>     .onCometChatCallEvents { event in
>         if case .callEnded(let call) = event { log("ended \(call.sessionID ?? "")") }
>     }
> ```

> [tab] UIKit
>
> ```swift theme={null}
> final class CallWatcher: NSObject, CometChatCallEventListener {
>     func ccCallEnded(call: Call) { print("ended", call.sessionID ?? "") }
> }
> ```
>
> Add it with `CometChatCallEvents.addListener("call-watcher", watcher)` — held weakly.


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