Skip to main content

Receiving chat messages

To be able to receive chat messages you need to implement a method onChatUpdates() method from callback DyteChatEventsListener. You can subscribe to this events by calling meeting.addChatEventsListener(dyteChatEventsListener)

meeting.addChatEventsListener(object :
DyteChatEventsListener {
override fun onChatUpdates(messages: List<DyteChatMessage>) {
// to load chat messages
}

override fun onNewChatMessage(message: DyteChatMessage) {
// when a new chat message is shared in the meeting
}
})

The onChatUpdates() method will be called whenever there is a change in the chat messages. The messages parameter is a list of DyteChatMessage objects that have been sent in the chat.

The onNewChatMessage() method will be called whenever a new chat message is shared in the meeting. The message parameter is a DyteChatMessage object that has been sent in the chat.