Documentation Index
Fetch the complete documentation index at: https://cometchat-22654f5b-docs-android-v6-beta2.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
AI Integration Quick Reference
AI Integration Quick Reference
How Events Work
- Subscribe to events using
addListenerinviewDidLoad - React to events in your listener callback methods
- Unsubscribe using
removeListenerinviewWillDisappear
User Events
Listen for user-related actions like blocking and unblocking.Emit User Events
Notify other components when you block/unblock a user:User Events Reference
| Event | Description |
|---|---|
ccUserBlocked | User was blocked by logged-in user |
ccUserUnblocked | User was unblocked by logged-in user |
Group Events
Listen for group-related actions like creating groups, adding members, and role changes.Emit Group Events
Notify other components about group actions:Group Events Reference
| Event | Description |
|---|---|
onGroupCreate | New group created |
onGroupDelete | Group deleted |
onCreateGroupClick | Create group button tapped |
onGroupMemberJoin | User joined a group |
onGroupMemberLeave | User left a group |
onGroupMemberAdd | Members added to group |
onGroupMemberKick | Member kicked from group |
onGroupMemberBan | Member banned from group |
onGroupMemberUnban | Member unbanned |
onGroupMemberChangeScope | Member role changed |
onOwnershipChange | Group ownership transferred |
Conversation Events
Listen for conversation-level actions like delete and update.Emit Conversation Events
Conversation Events Reference
| Event | Description |
|---|---|
ccConversationDeleted | Conversation was deleted |
ccUpdateConversation | Conversation was updated |
Message Events
Listen for message-related actions like send, edit, delete, and reactions.Emit Message Events
Message Events Reference
| Event | Description |
|---|---|
onMessageSent | Message sent (inProgress, success, or error) |
onMessageEdit | Message edited |
onMessageDelete | Message deleted |
onMessageRead | Message marked as read |
onMessageReply | Reply sent to a message |
onMessageReact | Reaction added to message |
onLiveReaction | Live reaction sent |
onParentMessageUpdate | Thread parent message updated |
onViewInformation | Info button tapped (user or group) |
onVoiceCall | Voice call initiated |
onVideoCall | Video call initiated |
onMessageError | Message operation failed |
Call Events
Listen for call-related actions like initiating, accepting, and ending calls.Emit Call Events
Call Events Reference
| Event | Description |
|---|---|
onCallInitiated | Outgoing call started |
onOutgoingCallAccepted | Recipient accepted the call |
onOutgoingCallRejected | Recipient rejected the call |
onIncomingCallAccepted | You accepted an incoming call |
onIncomingCallRejected | You rejected an incoming call |
onCallEnded | Call ended (any reason) |
Complete Example: App-Wide Event Manager
Create a centralized event manager to handle events across your entire app:Using the Event Manager
Best Practices
-
Always remove listeners - Call
removeListenerinviewWillDisappearto prevent memory leaks - Use unique listener IDs - Avoid conflicts between components by using descriptive, unique IDs
- Update UI on main thread - Dispatch UI updates to the main thread when handling events
- Don’t emit unnecessarily - Only emit events when state actually changes
- Use a central manager - For app-wide event handling, create a singleton manager
Next Steps
Methods
Reference for UI Kit wrapper methods.
Message List
Display and customize chat messages.
Conversations
Manage conversation lists.
Groups
Work with group chat functionality.