Chat SDK for Android v1.2.1
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)
default void onMessageContentChanged (ChatMessage messageModified, String operatorId, long operationTime)

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 modification is received, including the changed message ID.

messageThe modified message.
changeThe message modification.
Deprecated. Use ChatMessage#setMessageStatusCallback(CallBack) instead.

◆ onMessageContentChanged()

default void io.agora.MessageListener.onMessageContentChanged ( ChatMessage  messageModified,
String  operatorId,
long  operationTime 

Occurs when the message content is modified.

messageModifiedThe modified message object, where the message body contains the information such as the number of message modifications, the operator of the last modification, and the last modification time. Also, you can get the operator of the last message modification and the last modification time via the onMessageContentChanged method.
operatorIdThe user ID of the operator that modified the message last time.
operationTimeThe last message modification time. It is a UNIX timestamp in milliseconds.

◆ 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 is 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: