Skip to main content
FieldValue
Package@cometchat/chat-uikit-react-native
Importimport { CometChatUIEventHandler } from "@cometchat/chat-uikit-react-native";
Conversation eventsccConversationDeleted, ccUpdateConversation
User eventsccUserBlocked, ccUserUnblocked
Group eventsccGroupCreated, ccGroupDeleted, ccGroupLeft, ccGroupMemberScopeChanged, ccGroupMemberKicked, ccGroupMemberBanned, ccGroupMemberUnbanned, ccGroupMemberJoined, ccGroupMemberAdded, ccOwnershipChanged
Message eventsccMessageSent, ccMessageEdited, ccMessageDeleted, ccMessageRead, ccLiveReaction, plus SDK listener events
Call eventsonIncomingCallAccepted, onIncomingCallRejected, onCallEnded, onCallInitiated, onOutgoingCallAccepted, onOutgoingCallRejected
UI eventsccActiveChatChanged
PurposeDecoupled communication between UI Kit components — subscribe to events to react to changes without direct component references
Events provide decoupled communication between UI Kit components. Components emit events in response to user interactions or state changes, allowing other parts of the application to react without direct component references. Both Components and Composite Components have the ability to emit events. By emitting events, these components allow other parts of the application to react to changes or interactions, enabling dynamic and interactive behavior within the application.

CometChatConversationEventListener

CometChatConversationEventListener emits events when the logged-in user executes some action on a conversation object.
NameDescription
ccConversationDeletedThis event is triggered when the user successfully deletes a conversation.
ccUpdateConversationThis event is triggered to update a conversation in the conversation list. Takes a Conversation object to update.

CometChatUserEventListener

CometChatUserEventListener emits events when the logged-in user executes some action on an user object. It consists of the following events:
NameDescription
ccUserBlockedThis event is triggered when the user successfully blocks another user.
ccUserUnblockedThis event is triggered when the user successfully unblocks another user.

CometChatGroupEventListener

CometChatGroupEventListener emits events when the logged-in user executes some action on a group object. It consists of the following events:
NameDescription
ccGroupCreatedThis event is triggered when the user creates a group successfully
ccGroupDeletedThis event is triggered when the group member deletes the group successfully
ccGroupLeftThis event is triggered when the group member leaves the group successfully
ccGroupMemberScopeChangedThis event is triggered when the group member’s scope is updated successfully
ccGroupMemberKickedThis event is triggered when the group member is kicked
ccGroupMemberBannedThis event is triggered when the group member is banned
ccGroupMemberUnbannedThis event is triggered when the group member is un-banned
ccGroupMemberJoinedThis event is triggered when a user joins the group
ccGroupMemberAddedThis event is triggered when a user is added to the group
ccOwnershipChangedThis event is triggered when the group ownership is assigned to another group member

CometChatMessageEvents

CometChatMessageEvents emits events when the logged-in user executes some action on a message object. It consists of the following events:
NameDescription
ccMessageSentThis event is triggered when the sent message is in transit and also when it is received by the receiver.
ccMessageEditedThis event is triggered when the user successfully edits the message.
ccMessageDeletedThis event is triggered when the user successfully deletes the message.
ccMessageReadThis event is triggered when the sent message is read by the receiver.
ccLiveReactionThis event is triggered when the user sends a live reaction.
onTextMessageReceivedThis event is emitted when the CometChat SDK listener emits a text message.
onMediaMessageReceivedThis event is emitted when the CometChat SDK listener emits a media message.
onCustomMessageReceivedThis event is emitted when the CometChat SDK listener emits a custom message.
onTypingStartedThis event is emitted when the CometChat SDK listener indicates that a user has started typing.
onTypingEndedThis event is emitted when the CometChat SDK listener indicates that a user has stopped typing.
onMessagesDeliveredThis event is emitted when the CometChat SDK listener indicates that messages have been delivered.
onMessagesReadThis event is emitted when the CometChat SDK listener indicates that messages have been read.
onMessageEditedThis event is emitted when the CometChat SDK listener indicates that a message has been edited.
onMessageDeletedThis event is emitted when the CometChat SDK listener indicates that a message has been deleted.
onTransientMessageReceivedThis event is emitted when the CometChat SDK listener emits a transient message.
onInteractionGoalCompletedThis event is emitted when the CometChat SDK listener indicates that an interaction goal has been completed.
onFormMessageReceivedThis event is emitted when an interactive message of ‘form’ type is received from the CometChat SDK listener.
onCardMessageReceivedThis event is emitted when an interactive message of ‘card’ type is received from the CometChat SDK listener.
onSchedulerMessageReceivedThis event is emitted when an interactive message of ‘scheduler’ type is received from the CometChat SDK listener.
onCustomInteractiveMessageReceivedThis event is emitted when an interactive message of ‘customInteractive’ type is received from the CometChat SDK listener.

CometChatCallEvents

CometChatCallEvents emits events when the logged-in user executes some action on a call object. It consists of the following events:
NameDescription
func onIncomingCallAccepted(call: Call)Triggers whenever incoming call is accepted by the user
func onIncomingCallRejected(call: Call)Triggers whenever incoming call is rejected by the user
func onCallEnded(call: Call)Triggers whenever the call is ended
func onCallInitiated(call: Call)Triggers whenever the call is getting initiated
func onOutgoingCallAccepted(call: Call)Triggers whenever outgoing call is accepted by the user
func onOutgoingCallRejected(call: Call)Triggers whenever outgoing call is rejected by the user

CometChatUIEventListener

UI events refer to actions or interactions performed by a user within the CometChat UI Kit. These events are triggered when a user interacts with various UI elements, such as buttons, menus, checkboxes, input fields, or any other interactive components. It consists of the following events:
NameDescription
ccActiveChatChangedThis event is triggered when the user navigates to a particular chat window.

Next Steps