Receive a Chat Message
To receive chat messages, implement the onChatUpdates(...) method from callback DyteChatEventsListener. You can subscribe to these events by calling the following:
class ChatEventsListener with DyteChatEventsListener {
...
void onChatUpdates(List<DyteChatMessage> messages) {
// your code to handle new chat message
}
void onNewChatMessage(DyteChatMessage message) {
// your code to handle new chat message
}
...
}
dyteClient.addChatEventsListener(ChatEventsListener());
In this context, messages refers to a list of all the chat messages in the meeting. The type of message used is DyteChatMessage, which was introduced earlier in the introduction to Chat topic.
Whenever a chat message is received, the dyteClient.chat.messages list is automatically updated.