AI Integration Quick Reference
AI Integration Quick Reference
Overview
Events allow for a decoupled, flexible architecture where different parts of the application can interact without having to directly reference each other. This makes it easier to create complex, interactive experiences, as well as to extend and customize the functionality provided by the CometChat UI Kit.The event system is identical between V5 and V6. All event classes, listeners, and APIs work the same way.
User Events
CometChatUserEvents emit events when the logged-in user executes actions on another user.
ccUserBlocked: Triggered when the logged-in user blocks another user.ccUserUnblocked: Triggered when the logged-in user unblocks another user.
- Dart
Group Events
CometChatGroupEvents emits events when the logged-in user performs actions related to groups.
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.ccGroupMemberScopeChanged: Triggered when the logged-in user changes the scope of another group member.ccGroupMemberBanned: Triggered when the logged-in user bans a group member.ccGroupMemberKicked: Triggered when the logged-in user kicks a group member.ccGroupMemberUnbanned: Triggered when the logged-in user unbans a user.ccGroupMemberJoined: Triggered when the logged-in user joins a group.ccGroupMemberAdded: Triggered when the logged-in user adds new members.ccOwnershipChanged: Triggered when the logged-in user transfers ownership.
- Dart
Message Events
CometChatMessageEvents emit events when the logged-in user executes actions on a message.
ccMessageSent: Triggered when the logged-in user sends a message.ccMessageEdited: Triggered when the logged-in user edits a message.ccMessageDeleted: Triggered when the logged-in user deletes a message.ccMessageRead: Triggered when the logged-in user reads a message.ccLiveReaction: Triggered when the logged-in user sends a live reaction.ccMessageForwarded: Triggered when the logged-in user forwards a message.ccReplyToMessage: Triggered when the logged-in user replies to a message.onFormMessageReceived: Triggered when a form message is received.onSchedulerMessageReceived: Triggered when a scheduler message is received.onCustomInteractiveMessageReceived: Triggered when a custom interactive message is received.
- Dart
Emitting ccMessageSent for messages you send yourself
CometChatMessageComposer emits ccMessageSent for you. If you send a message with the SDK directly
— CometChat.sendCustomMessage, sendTextMessage, sendMediaMessage — you must emit it yourself, or
an already-mounted CometChatMessageList will not show that message.
CometChat does not deliver your own sends back to you over the real-time listener, so a list that is
already on screen has no way to learn about them and only picks them up on its next fetch. That hides
the problem whenever a chat screen is opened fresh each time, and surfaces it as soon as a list stays
mounted — for example a chat panel kept alongside other UI.
- Dart
Conversation Events
CometChatConversationEvents emits events related to conversations.
ccConversationDeleted: Triggered when a conversation is deleted.ccUpdateConversation: Triggered when a conversation is updated — for example when it is marked as unread.
- Dart
Call Events
CometChatCallEvents emit events when the logged-in user acts on a call. They are UI-Kit
events — distinct from the Calls SDK’s own listeners — and fire for calls started or
answered through the kit’s calling widgets.
ccOutgoingCall: Triggered when the logged-in user initiates an outgoing call.ccCallAccepted: Triggered when the logged-in user accepts an incoming call.ccCallRejected: Triggered when the logged-in user rejects an incoming call.ccCallEnded: Triggered when a call the logged-in user was on has ended.
- Dart
UI Events
CometChatUIEvents emits CometChatUIEventListener callbacks for UI-level actions such as panel visibility, active chat changes, and card action taps. Add a listener with CometChatUIEvents.addUiListener(listenerId, this) and remove it in dispose().
Event types:
- Dart
The UI Kit renders card bubbles automatically (
CometChatCardBubble) and emits ccCardActionClicked when a user taps an action inside one — so a single subscriber handles every card action across your app. message is a CardMessage for standalone card messages and an AIAssistantMessage for cards embedded in AI agent replies. Cast action to CometChatCardActionEvent to read its action, elementId, and cardJson. See also Methods → UI Events — Card Actions.