Public Member Functions

abstract void setText (String text)
 
abstract String getText ()
 
abstract long getServerReceivedTs ()
 
abstract boolean isOfflineMessage ()
 

Detailed Description

Class for retrieving the attributes of an Agora RTM channel or peer-to-peer message.

Member Function Documentation

◆ setText()

abstract void io.agora.rtm.RtmMessage.setText ( String  text)
abstract

Sets the channel or peer-to-peer text message.

Note The maximum length is 32 KB.

Parameters
textThe text message to be set.

◆ getText()

abstract String io.agora.rtm.RtmMessage.getText ( )
abstract

Retrieves the text content of the channel or peer-to-peer text message.

Returns
The text message.

◆ getServerReceivedTs()

abstract long io.agora.rtm.RtmMessage.getServerReceivedTs ( )
abstract

Allows the receiver to retrieve the timestamp of when the messaging server receives this message (Applies to peer-to-peer message only).

Note The returned timestamp is on a millisecond time-scale. It is for demonstration purposes only, not for strict ordering of messages.

Returns
The timestamp (ms) of when the messaging server receives this message.

◆ isOfflineMessage()

abstract boolean io.agora.rtm.RtmMessage.isOfflineMessage ( )
abstract

Allows the receiver to check whether this message has been cached on the server (Applies to peer-to-peer message only).

Note This method returns false if a message is not cached by the server. Only if the sender sends the message as an offline message (sets enableOfflineMessaging as true) when the specified user is offline, does the method return true when the user is back online.

Returns
  • true: This message has been cached on the server (the server caches this message and resends it to the receiver when he/she is back online).
  • false: This message has not been cached on the server.