Skip to main content

Receiving chat messages

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

    extension MeetingViewModel: DyteMeetingRoomEventsListener {
func onChatUpdates(messages: [DyteChatMessage]) {
// any update in chat messages
}

func onNewChatMessage(message: DyteChatMessage) {
// updates for new chat messages only
}
}

Here, the message is of type Message, as defined in introduction. messages is a list of all chat messages in the meeting, which is the same as meeting.chat.messages.

When a chat message is received, the meeting.chat.messages list is also updated.