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

# Setup

> CometChat Calling SDK v5 - Setup for React Native

<Info>
  **Faster Integration with UI Kits**

  If 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

  👉 [React Native UI Kit Calling Integration](/ui-kit/react-native/call-features)

  Use this Calls SDK directly only if you need custom call UI or advanced control.
</Info>

This guide walks you through installing the CometChat Calls SDK and configuring it in your React Native application.

## Add the CometChat Dependency

### Using npm

```bash theme={null}
npm install @cometchat/calls-sdk-react-native@5.0.0
```

### Using Yarn

```bash theme={null}
yarn add @cometchat/calls-sdk-react-native@5.0.0
```

## iOS Configuration

### Install CocoaPods Dependencies

Navigate to your iOS directory and install the pods:

```bash theme={null}
cd ios
pod install
cd ..
```

### Add Permissions

Add the required permissions to your `ios/YourApp/Info.plist`:

```xml theme={null}
<key>NSCameraUsageDescription</key>
<string>Camera access is required for video calls</string>
<key>NSMicrophoneUsageDescription</key>
<string>Microphone access is required for voice and video calls</string>
```

### Enable Background Modes

For calls to continue when the app is in the background:

1. Open your project in Xcode
2. Select your target and go to **Signing & Capabilities**
3. Click **+ Capability** and add **Background Modes**
4. Enable:
   * **Audio, AirPlay, and Picture in Picture**
   * **Voice over IP** (if using VoIP push notifications)

## Android Configuration

### Add Repository

Add the CometChat repository to your **project level** `android/build.gradle`:

```groovy theme={null}
allprojects {
    repositories {
        google()
        mavenCentral()
        maven {
            url "https://dl.cloudsmith.io/public/cometchat/cometchat/maven/"
        }
    }
}
```

### Configure Java Version

Add Java 8 compatibility to your **app level** `android/app/build.gradle`:

```groovy theme={null}
android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}
```

### Add Permissions

Add the required permissions to your `android/app/src/main/AndroidManifest.xml`:

```xml theme={null}
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
```

<Note>
  For Android 6.0 (API level 23) and above, you must request camera and microphone permissions at runtime before starting a call.
</Note>

### Request Runtime Permissions

Use a library like `react-native-permissions` or implement native permission requests:

```tsx theme={null}
import { PermissionsAndroid, Platform } from 'react-native';

async function requestCallPermissions(): Promise<boolean> {
  if (Platform.OS === 'android') {
    const granted = await PermissionsAndroid.requestMultiple([
      PermissionsAndroid.PERMISSIONS.CAMERA,
      PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,
    ]);
    
    return (
      granted['android.permission.CAMERA'] === PermissionsAndroid.RESULTS.GRANTED &&
      granted['android.permission.RECORD_AUDIO'] === PermissionsAndroid.RESULTS.GRANTED
    );
  }
  return true;
}
```

## Verify Installation

After installation, rebuild your app:

```bash theme={null}
# iOS
npx react-native run-ios

# Android
npx react-native run-android
```

## Related Documentation

* [Authentication](/calls/react-native/authentication) - Initialize the SDK and authenticate users
* [Join Session](/calls/react-native/join-session) - Start your first call
