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)

extension MeetingViewModel: DyteChatEventsListener {
func onChatUpdates(messages: [DyteChatMessage]) {
// to load chat messages
}

func 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.