Chat SDK for Android v1.1.0
agora java chat SDK
Public Member Functions | List of all members
io.agora.MessageListener Interface Reference

Public Member Functions

void onMessageReceived (List< ChatMessage > messages)
default void onCmdMessageReceived (List< ChatMessage > messages)
default void onMessageRead (List< ChatMessage > messages)
default void onGroupMessageRead (List< GroupReadAck > groupReadAcks)
default void onReadAckForGroupMessageUpdated ()
default void onMessageDelivered (List< ChatMessage > messages)
default void onMessageRecalled (List< ChatMessage > messages)
default void onMessageChanged (ChatMessage message, Object change)
default void onReactionChanged (List< MessageReactionChange > messageReactionChangeList)

Detailed Description

The message event listener. This listener is used to check whether messages are received. If messages are sent successfully, a delivery receipt will be returned (delivery receipt needs to be enabled: If the peer reads the received message, a read receipt will be returned (read receipt needs to be enabled: During message delivery, the message ID will be changed from a local uuid to a global unique ID that is generated by the server to uniquely identify a message on all devices using the SDK. This API should be implemented in the app to listen for message status changes.

Adds the message listener:

Removes the message listener:

Member Function Documentation

◆ onCmdMessageReceived()

default void io.agora.MessageListener.onCmdMessageReceived ( List< ChatMessage messages)

Occurs when a command message is received. Unlike MessageListener#onMessageReceived(List), this callback only contains a command message body that is usually invisible to users.

◆ onGroupMessageRead()

default void io.agora.MessageListener.onGroupMessageRead ( List< GroupReadAck groupReadAcks)

Occurs when a read receipt is received for a group message.

◆ onMessageChanged()

default void io.agora.MessageListener.onMessageChanged ( ChatMessage  message,
Object  change 

Occurs when a message change notification is received, including the message ID change.

messageThe changed message.
changeThe message change.
Please use ChatMessage#setMessageStatusCallback(CallBack) instead.

◆ onMessageDelivered()

default void io.agora.MessageListener.onMessageDelivered ( List< ChatMessage messages)

Occurs when a delivery receipt is received.

◆ onMessageRead()

default void io.agora.MessageListener.onMessageRead ( List< ChatMessage messages)

Occurs when a read receipt is received for a message.

◆ onMessageRecalled()

default void io.agora.MessageListener.onMessageRecalled ( List< ChatMessage messages)

Occurs when a received message is recalled.

◆ onMessageReceived()

void io.agora.MessageListener.onMessageReceived ( List< ChatMessage messages)

Occurs when a message is received. This callback is triggered to notify the user when a message such as texts or an image, video, voice, location, or file is received.

◆ onReactionChanged()

default void io.agora.MessageListener.onReactionChanged ( List< MessageReactionChange messageReactionChangeList)

Occurs when a message Reaction changed. The SDK triggers the onReactionChanged callback, notifying that the message Reaction changed.

◆ onReadAckForGroupMessageUpdated()

default void io.agora.MessageListener.onReadAckForGroupMessageUpdated ( )

Occurs when the update for the group message read status is received.

The documentation for this interface was generated from the following file: