Skip to main content
Version: v4

Events

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.

Both Components and Composite Components have the ability to emit events. These events are dispatched in response to certain changes or user interactions within the component. By emitting events, these components allow other parts of the application to react to changes or interactions, thus 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.

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's 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.