Events
Events
Ncloud Chat provides the Event Listener function, which can handle diverse events that occur from the client side. With this function, you can monitor many circumstances occurring in the chat application in real time and respond to them properly. The following describes the main events and how to handle events.
Main event types
Receive message: triggered when a new message is received.
Delete message: triggered when a message is deleted.
Error message: triggered when an error occurs.
Connected: triggered when successfully connected to the server.
Disconnected: triggered when disconnected from the server.
Typing start and end: triggered when you start or end typing.
Add and remove members: triggered when a user is added or removed.
Member suspension and withdrawal: triggered when a user gets suspended in the channel or withdraws from the channel.
The following shows how to listen for events on the client side.
Connect and disconnect event handler
With event handlers, you can receive diverse events, and implement the logic you need. The following codes show how to connect and disconnect the event handler for each event.
With Event Listener, the user of Ncloud Chat can identify the change of the chat environment in real time and respond to it properly.
Last updated