Faster Integration with UI KitsIf 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
Add the CometChat Dependency
Step 1: Add Repository
Add the CometChat repository URL to your project levelbuild.gradle file in the repositories block. Keep google() and mavenCentral() in the list: the Calls SDK’s WebRTC library (org.jitsi:webrtc) is resolved from Maven Central.
- Groovy
- Kotlin DSL
If your project declares repositories in
settings.gradle (dependencyResolutionManagement) instead of
allprojects, add the same three entries there.Step 2: Add Dependencies
Add the Calls SDK dependency to your app levelbuild.gradle file:
- Groovy
- Kotlin DSL
Ringing users? Incoming calls ring through the Push Notifications SDK’s calls module. Add
com.cometchat:push-notifications-android:2.0.0 and com.cometchat:push-notifications-calls-android:2.0.0
as well, and follow Push Ringing. The Calls SDK alone can start, join and end
calls, but it cannot ring a device that is not running your app.The Calls SDK carries its own React Native runtime, relocated to the
cometchat.rn.* namespace so it does not clash
with other React Native code in your app, and it initializes the runtime’s native libraries itself. Do not add
react-android or soloader dependencies or call SoLoader.init for the Calls SDK.Step 3: Configure Java Version
Add Java 17 compatibility to theandroid section of your app level build.gradle — the Calls SDK is built with Java 17. The kotlinOptions block applies only if your module uses Kotlin (Java-only modules should omit it); on Kotlin 2.x, prefer compilerOptions { jvmTarget.set(JvmTarget.JVM_17) }:
- Groovy
- Kotlin DSL
Add Permissions
The Calls SDK’s own manifest declares the permissions a call needs (INTERNET, CAMERA, RECORD_AUDIO,
MODIFY_AUDIO_SETTINGS, ACCESS_NETWORK_STATE, the microphone and camera foreground-service types, and others), and
Android merges them into your app. There is nothing to add to your AndroidManifest.xml for audio and video calls.
Screen sharing (opt-in)
Screen sharing is opt-in. Android needs a foreground service of typemediaProjection to share the screen, and
Google Play asks every app that declares one to justify it, so the Calls SDK removes that service from the merged
manifest. Until your app declares it, the screen share button is hidden in the call UI. To enable screen sharing, add
the permission and the service to your AndroidManifest.xml:
mediaProjection type) and, when your app targets Android 14 or later, for
the permission. If either is missing, it logs why and keeps the screen share button hidden.
Request camera and microphone permissions at runtime before starting or joining a call. When a call is answered from
the Push SDK’s ring, the SDK asks for them before opening your answer activity; a denied microphone joins muted. On
Android 14+ the call’s foreground service is blocked while the microphone permission is missing.
Initialize CometChat Calls
Theinit() method initializes the SDK with your app credentials. Call this method once when your application starts, typically in your Application class or main Activity.
CallAppSettings
TheCallAppSettings class configures the SDK initialization:
- Kotlin
- Java
Check Initialization Status
You can verify if the SDK has been initialized using theisInitialized() method:
- Kotlin
- Java