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.
Name | Description |
---|---|
ccConversationDeleted | This 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:
Name | Description |
---|---|
ccUserBlocked | This event is triggered when the user successfully blocks another user. |
ccUserUnblocked | This 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:
Name | Description |
---|---|
ccGroupCreated | This event is triggered when the user creates a group successfully |
ccGroupDeleted | This event is triggered when the group member deletes the group successfully |
ccGroupLeft | This event is triggered when the group member leaves the group successfully |
ccGroupMemberScopeChanged | This event is triggered when the group member's scope is updated successfully |
ccGroupMemberKicked | This event is triggered when the group member is kicked |
ccGroupMemberBanned | This event is triggered when the group member is banned |
ccGroupMemberUnbanned | This event is triggered when the group member is un-banned |
ccGroupMemberJoined | This event is triggered when a user joins the group |
ccGroupMemberAdded | This event is triggered when a user is added to the group |
ccOwnershipChanged | This 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:
Name | Description |
---|---|
ccMessageSent | This event is triggered when the sent message is in transit and also when it is received by the receiver. |
ccMessageEdited | This event is triggered when the user successfully edits the message. |
ccMessageDeleted | This event is triggered when the user successfully deletes the message. |
ccMessageRead | This event is triggered when the sent message is read by the receiver. |
ccLiveReaction | This event is triggered when the user sends a live reaction. |
onTextMessageReceived | This event is emitted when the CometChat SDK listener emits a text message. |
onMediaMessageReceived | This event is emitted when the CometChat SDK listener emits a media message. |
onCustomMessageReceived | This event is emitted when the CometChat SDK listener emits a custom message. |
onTypingStarted | This event is emitted when the CometChat SDK listener indicates that a user has started typing. |
onTypingEnded | This event is emitted when the CometChat SDK listener indicates that a user has stopped typing. |
onMessagesDelivered | This event is emitted when the CometChat SDK listener indicates that messages have been delivered. |
onMessagesRead | This event is emitted when the CometChat SDK listener indicates that messages have been read. |
onMessageEdited | This event is emitted when the CometChat SDK listener indicates that a message has been edited. |
onMessageDeleted | This event is emitted when the CometChat SDK listener indicates that a message has been deleted. |
onTransientMessageReceived | This event is emitted when the CometChat SDK listener emits a transient message. |
onInteractionGoalCompleted | This event is emitted when the CometChat SDK listener indicates that an interaction goal has been completed. |
onFormMessageReceived | This event is emitted when an interactive message of 'form' type is received from the CometChat SDK listener. |
onCardMessageReceived | This event is emitted when an interactive message of 'card' type is received from the CometChat SDK listener. |
onSchedulerMessageReceived | This event is emitted when an interactive message of 'scheduler' type is received from the CometChat SDK listener. |
onCustomInteractiveMessageReceived | This 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:
Name | Description |
---|---|
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:
Name | Description |
---|---|
ccActiveChatChanged | This event is triggered when the user navigates to a particular chat window. |