> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-rn-guide-message-privately.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Call

> Integrate CometChat Flutter UI Kit calling with one-on-one and group audio/video calls, setup, initialization, and call events.

## Overview

CometChat's Calls feature allows you to integrate one-on-one and group audio/video calling capabilities into your application. In V6, calling is built into the `cometchat_chat_uikit` package — no separate calls dependency needed.

## Integration

### Step 1: Add Dependency

Since V6 is hosted on Cloudsmith, install via CLI:

<Tabs>
  <Tab title="Dart">
    ```bash theme={null}
    dart pub add cometchat_chat_uikit:6.0.0 --hosted-url https://dart.cloudsmith.io/cometchat/cometchat/
    ```
  </Tab>
</Tabs>

Or add manually to `pubspec.yaml`:

<Tabs>
  <Tab title="Dart">
    ```yaml theme={null}
    dependencies:
      cometchat_chat_uikit:
        hosted: https://dart.cloudsmith.io/cometchat/cometchat/
        version: 6.0.0
    ```
  </Tab>
</Tabs>

***

### Step 2: Update build.gradle

Set `minSdkVersion` to at least 24 in `android/app/build.gradle`:

<Tabs>
  <Tab title="Groovy">
    ```gradle theme={null}
    defaultConfig {
        minSdkVersion 24
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }
    ```
  </Tab>
</Tabs>

***

### Step 3: Update iOS Podfile

In `ios/Podfile`, set the minimum iOS version to 12:

```
platform :ios, '12.0'
```

***

### Step 4: Modify UIKitSettings

Activate calling features by setting `enableCalls` to `true` in UIKitSettings:

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    UIKitSettings uiKitSettings = (UIKitSettingsBuilder()
      ..subscriptionType = CometChatSubscriptionType.allUsers
      ..autoEstablishSocketConnection = true
      ..region = "REGION"
      ..appId = "APP_ID"
      ..authKey = "AUTH_KEY"
      ..enableCalls = true
      ..callingConfiguration = CallingConfiguration()
    ).build();

    CometChatUIKit.init(uiKitSettings: uiKitSettings,
      onSuccess: (successMessage) {},
      onError: (e) {},
    );
    ```
  </Tab>
</Tabs>

To allow launching the Incoming Call screen from any widget, provide the navigator key:

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    MaterialApp(
      navigatorKey: CallNavigationContext.navigatorKey,
      home: YourHomeScreen(),
    )
    ```
  </Tab>
</Tabs>

### Listeners

Register call listeners for top-level widgets:

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    class _YourClassNameState extends State<YourClassName> with CallListener {
      @override
      void initState() {
        super.initState();
        CometChat.addCallListener(listenerId, this);
      }

      @override
      void dispose() {
        super.dispose();
        CometChat.removeCallListener(listenerId);
      }

      @override
      void onIncomingCallReceived(Call call) {
        debugPrint("onIncomingCallReceived");
      }

      @override
      void onOutgoingCallAccepted(Call call) {
        debugPrint("onOutgoingCallAccepted");
      }

      @override
      void onOutgoingCallRejected(Call call) {
        debugPrint("onOutgoingCallRejected");
      }

      @override
      void onIncomingCallCancelled(Call call) {
        debugPrint("onIncomingCallCancelled");
      }

      @override
      void onCallEndedMessageReceived(Call call) {
        debugPrint("onCallEndedMessageReceived");
      }

      @override
      Widget build(BuildContext context) {
        return const Placeholder();
      }
    }
    ```
  </Tab>
</Tabs>

***

## Features

### Incoming Call

The Incoming Call widget lets users receive real-time audio and video calls. When a call is received, it displays caller information with accept/reject options.

### Outgoing Call

The Outgoing Call widget manages the outgoing call process. It displays recipient information and call status, and automatically transitions to the ongoing call screen when accepted.

### Call Logs

The [Call Logs](/ui-kit/flutter/call-logs) widget displays records of call events including caller, time, and duration.
