Skip to main content
CometChatCallButtons renders voice and video call buttons and initiates calls for the bound User or Group. Place it in a CometChatMessageHeader or anywhere a call action is needed.

Where It Fits

CometChatCallButtons is a utility component. Wire it into a CometChatMessageHeader or place it standalone wherever a call action is needed.
activity_chat.xml

Quick Start

Add to your layout XML:
Set a User or Group — required before calls can be initiated:
Or programmatically:
Prerequisites: CometChat SDK initialized with CometChatUIKit.init(), a user logged in, and the UI Kit dependency added.
You must call setUser(User) or setGroup(Group) before the buttons can initiate a call. Without a target, button clicks have no effect.

Actions and Events

Callback Methods

onVoiceCallClick

Fires when the voice call button is tapped. Replaces the default behavior of initiating an audio call.

onVideoCallClick

Fires when the video call button is tapped. Replaces the default behavior of initiating a video call.

onError

Fires on internal errors (network failure, auth issue, SDK exception).

Global UI Events (CometChatCallEvents)


Functionality


Style

Define a custom style in themes.xml:
themes.xml
See Component Styling for the full reference.

ViewModel

See ViewModel & Data for state observation and custom repositories.

Next Steps

Call Logs

View call history

Incoming Call

Incoming call notification with accept/reject

Outgoing Call

Outgoing call screen with end-call button

Message Header

Display user/group info in the toolbar