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:
- Groovy
- Kotlin DSL
Step 2: Add Dependencies
Add the Calls SDK dependency to your app levelbuild.gradle file:
- Groovy
- Kotlin DSL
Step 3: Configure Java Version
Add Java 8 compatibility to theandroid section of your app level build.gradle:
- Groovy
- Kotlin DSL
Step 4: Initialize the Native Loader
Required. The Calls SDK renders its call surface through an embedded React Native runtime. React Native 0.76+ ships a single merged native library and resolves the individual library names throughOpenSourceMergedSoMapping, which must be registered with SoLoader before the first call surface is
created. Do it once, in your Application.onCreate():
- Kotlin
- Java
AndroidManifest.xml:
Why this step exists. The SDK already performs this initialization internally, but only on the
legacy
startSession() path - it was not carried over to either joinSession() overload, which is
the v5 API this guide uses. Until a future 5.0.x moves it, the app has to do it. Integrations still
on startSession(), and some UI Kit setups, will not see the crash for that reason - do not rely on
it, since the recommended v5 flow does not take that path.Add Permissions
Add the required permissions to yourAndroidManifest.xml:
For Android 6.0 (API level 23) and above, you must request camera and microphone permissions at runtime before starting a call.
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