Overview
CometChat’s Calls feature is an advanced functionality that allows you to seamlessly integrate one-on-one as well as group audio and video calling capabilities into your application. This document provides a technical overview of these features, as implemented in the Android UI Kit.Integration
First, make sure that you’ve correctly integrated the UI Kit library into your project. If you haven’t done this yet or are facing difficulties, refer to our Getting Started guide. This guide will walk you through a step-by-step process of integrating our UI Kit into your Android project. Once you’ve successfully integrated the UI Kit, the next step is to add the CometChat Calls SDK to your project. This is necessary to enable the calling features in the UI Kit.Step 1: Add Calls SDK Dependency
Add the following dependency to yourbuild.gradle file:
Step 2: Verify Call Buttons Appear
Once the Calls SDK is integrated, you will see the CallButtons component automatically rendered in the MessageHeader component. This provides users with quick access to initiate audio and video calls.
Step 3: Add Call Listener for Incoming Calls
To receive incoming calls globally in your app, you will need to add aCallListener. This should be added before you initialize the CometChat UI Kit. We recommend creating a custom Application class and adding the call listener there.
When an incoming call is received, you can display the CometChatIncomingCall component using the current activity context.
- Java
- Kotlin
Call Components
The CometChat Android UI Kit provides four main components for implementing calling features in your app. Each component handles a specific part of the calling experience.Call Buttons
The Call Buttons component provides users with quick access to initiate audio and video calls. This component is automatically rendered in the MessageHeader when the Calls SDK is integrated.
Incoming Call
The Incoming Call component displays when a user receives an incoming call. It provides a full-screen interface showing caller information and call controls.
Outgoing Call
The Outgoing Call component manages the outgoing call experience. It displays while waiting for the recipient to answer and automatically transitions to the active call screen once accepted.
Call Logs
The Call Logs component displays a history of all call activities, including missed, received, and dialed calls. Users can view call details and initiate new calls from the log.
Call Log Details
For detailed information about individual calls, including participants, join/leave history, and recordings, see the Call Log Details guide.Troubleshooting
Call Buttons Not Appearing
If the call buttons don’t appear in the MessageHeader:- Verify Calls SDK is added - Check that
com.cometchat:calls-sdk-android:4.+.+is in yourbuild.gradle - Sync Gradle - Make sure you’ve synced your project after adding the dependency
- Check UI Kit version - Ensure you’re using CometChat UI Kit v5 or later
- Verify initialization - Confirm CometChat is properly initialized before loading the UI
Incoming Calls Not Showing
If incoming calls aren’t displaying:- Check CallListener registration - Ensure
CometChat.addCallListener()is called in your Application class - Verify Application class - Confirm your custom Application class is registered in
AndroidManifest.xml - Test listener ID - Make sure the listener ID is unique and not being removed elsewhere