AI Agent Component Spec
AI Agent Component Spec
| Field | Value |
|---|---|
| Package | com.cometchat:chat-uikit-android |
| Conversation events | ccConversationDeleted |
| User events | ccUserBlocked, ccUserUnblocked |
| Group events | ccGroupCreated, ccGroupDeleted, ccGroupLeft, ccGroupMemberScopeChanged, ccGroupMemberKicked, ccGroupMemberBanned, ccGroupMemberUnBanned, ccGroupMemberJoined, ccGroupMemberAdded, ccOwnershipChanged |
| Message events | ccMessageSent, ccMessageEdited, ccMessageDeleted, ccMessageRead, ccLiveReaction |
| Call events | ccOutgoingCall, ccCallAccepted, ccCallRejected, ccCallEnded |
| Purpose | Decoupled communication between UI Kit components — subscribe to events to react to changes without direct component references |
When to use this
- You need to update your UI when a user is blocked or unblocked.
- You need to respond to group actions such as member joins, kicks, bans, or ownership transfers.
- You need to track conversation deletions or updates in real time.
- You need to react to messages being sent, edited, deleted, or read.
- You need to handle call lifecycle events (outgoing, accepted, rejected, ended).
- You need to respond to UI-level events such as panel visibility changes or active chat changes.
Prerequisites
- The
cometchat-chat-uikit-androiddependency added to your project. CometChatUIKit.init()called and completed successfully.- A logged-in CometChat user (call
CometChatUIKit.login()before registering listeners).
API reference
User Events
CometChatUserEvents emits events when the logged-in user executes actions on another user. This class provides methods to add and remove listeners for user events, as well as methods to handle specific user actions such as blocking and unblocking users.
Events:
| Event | Description |
|---|---|
ccUserBlocked | Triggered when the logged-in user blocks another user. |
ccUserUnblocked | Triggered when the logged-in user unblocks another user. |
- Kotlin
- Java
What this does: Registers a listener onCometChatUserEventsusing a uniqueLISTENERS_TAG. TheccUserBlockedcallback fires when the logged-in user blocks another user, andccUserUnblockedfires when the logged-in user unblocks another user.
Group Events
CometChatGroupEvents emits events when the logged-in user performs actions related to groups. This class provides methods to listen to various group-related events and handle them.
Events:
| Event | Description |
|---|---|
ccGroupCreated | Triggered when the logged-in user creates a group. |
ccGroupDeleted | Triggered when the logged-in user deletes a group. |
ccGroupLeft | Triggered when the logged-in user leaves a group. Provides the action message, the user who left, and the group. |
ccGroupMemberScopeChanged | Triggered when the logged-in user changes the scope of another group member. Provides the action message, updated user, new scope, previous scope, and group. |
ccGroupMemberBanned | Triggered when the logged-in user bans a group member from the group. Provides the action message, banned user, who banned them, and the group. |
ccGroupMemberKicked | Triggered when the logged-in user kicks another group member from the group. Provides the action message, kicked user, who kicked them, and the group. |
ccGroupMemberUnBanned | Triggered when the logged-in user unbans a user banned from the group. Provides the action message, unbanned user, who unbanned them, and the group. |
ccGroupMemberJoined | Triggered when the logged-in user joins a group. Provides the joined user and the group. |
ccGroupMemberAdded | Triggered when the logged-in user adds new members to the group. Provides action messages, added users, the group, and who added them. |
ccOwnershipChanged | Triggered when the logged-in user transfers the ownership of their group to some other member. Provides the group and the new owner (as GroupMember). |
- Kotlin
- Java
What this does: Registers a listener onCometChatGroupEventsusing a uniqueLISTENERS_TAG. Each callback fires when the logged-in user performs the corresponding group action — creating, deleting, leaving a group, or managing members (scope change, ban, kick, unban, join, add, ownership transfer).
Conversation Events
CometChatConversationEvents emits events when the logged-in user performs actions related to conversations. This allows the UI to be updated when conversations change.
Events:
| Event | Description |
|---|---|
ccConversationDeleted | Triggered when the logged-in user deletes a conversation. |
ccUpdateConversation | Triggered when there is an update in the conversation. |
- Kotlin
- Java
What this does: Registers a listener onCometChatConversationEventsusing a unique listener tag. TheccConversationDeletedcallback fires when the logged-in user deletes a conversation, andccUpdateConversationfires when a conversation is updated.
Message Events
CometChatMessageEvents emits events when various actions are performed on messages within the application. These events facilitate updating the UI when messages change.
Events:
| Event | Description |
|---|---|
ccMessageSent | Triggered whenever a logged-in user sends any message. It can have two states: inProgress and sent. |
ccMessageEdited | Triggered whenever a logged-in user edits any message from the list of messages. It can have two states: inProgress and sent. |
ccMessageDeleted | Triggered whenever a logged-in user deletes any message from the list of messages. |
ccMessageRead | Triggered whenever a logged-in user reads any message. |
ccLiveReaction | Triggered whenever a logged-in user clicks on live reaction. |
onFormMessageReceived | Triggered when a form message is received. |
onCardMessageReceived | Triggered when a card message is received. |
onCustomInteractiveMessageReceived | Triggered when a custom interactive message is received. |
onInteractionGoalCompleted | Triggered when an interaction goal is completed. |
onSchedulerMessageReceived | Triggered when a scheduler message is received. |
- Kotlin
- Java
What this does: Registers a listener onCometChatMessageEventsusing a unique ID string. The callbacks fire for message lifecycle events — sending, editing, deleting, reading messages, and reacting with live reactions. Additional overrides handle interactive message types (onFormMessageReceived,onCardMessageReceived,onCustomInteractiveMessageReceived,onInteractionGoalCompleted,onSchedulerMessageReceived).
Call Events
CometChatCallEvents emits events related to calls within the application. This class provides methods to listen to call-related events and handle them.
Events:
| Event | Description |
|---|---|
ccOutgoingCall | Triggered when the logged-in user initiates an outgoing call. |
ccCallAccepted | Triggered when a call is accepted. |
ccCallRejected | Triggered when a call is rejected. |
ccCallEnded | Triggered when a call is ended. |
- Kotlin
- Java
What this does: Registers a listener onCometChatCallEventsusing a unique"ListenerID". The callbacks fire for each stage of the call lifecycle — initiating an outgoing call, accepting, rejecting, and ending a call.
UI Events
CometChatUIEvents emits events related to UI components within the CometChat UI Kit. This class provides methods to listen to UI-related events and handle them.
Events:
| Event | Description |
|---|---|
showPanel | Triggered to show an additional UI panel with custom elements. |
hidePanel | Triggered to hide a previously shown UI panel. |
ccActiveChatChanged | Triggered when the active chat changes, providing information about the current message, user, and group. |
ccOpenChat | Triggered to open a chat with a specific user or group. |
- Kotlin
- Java
What this does: Registers a listener on CometChatUIEvents using a unique ID string. The callbacks fire for UI-level actions — showing or hiding custom panels, reacting to active chat changes, and opening a chat with a specific user or group.