Signaling (previously RTM) v1.4.8 API Reference for Unity
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
agora_rtm.IMessage Class Reference

Inherited by agora_rtm.FileMessage, agora_rtm.ImageMessage, and agora_rtm.TextMessage.

Public Member Functions

Int64 GetMessageId ()
 
MESSAGE_TYPE GetMessageType ()
 
void SetText (string text)
 
string GetText ()
 
byte[] GetRawMessageData ()
 
int GetRawMessageLength ()
 
Int64 GetServerReceiveTs ()
 
bool IsOfflineMessage ()
 
IntPtr GetPtr ()
 
void SetMessagePtr (IntPtr messagePtr)
 

Public Attributes

int _Length = 0
 

Protected Member Functions

void Release ()
 

Protected Attributes

MESSAGE_FLAG _MessageFlag = MESSAGE_FLAG.RECEIVE
 
IntPtr _MessagePtr = IntPtr.Zero
 
Int64 _MessageId = 0
 
MESSAGE_TYPE _MessageType = MESSAGE_TYPE.MESSAGE_TYPE_UNDEFINED
 
string _MessageText = ""
 
bool _IsOfflineMessage = false
 
Int64 _Ts = 0
 
byte[] _RawMessageData = null
 

Member Function Documentation

◆ GetMessageId()

Int64 agora_rtm.IMessage.GetMessageId ( )
inline

Retrieves the unique ID of the message.

Returns
The message ID.

◆ GetMessageType()

MESSAGE_TYPE agora_rtm.IMessage.GetMessageType ( )
inline

Retrieves the message type.

Returns
The message type. See MESSAGE_TYPE.

◆ GetPtr()

IntPtr agora_rtm.IMessage.GetPtr ( )
inline

◆ GetRawMessageData()

byte [] agora_rtm.IMessage.GetRawMessageData ( )
inline

Retrieves the payload of the raw message.

Returns
The payload of the raw message.

◆ GetRawMessageLength()

int agora_rtm.IMessage.GetRawMessageLength ( )
inline

Get the length of the raw message.

Returns
The length of the raw message

◆ GetServerReceiveTs()

Int64 agora_rtm.IMessage.GetServerReceiveTs ( )
inline

Allows the receiver to retrieve the timestamp of when the messaging server receives this message.

Note
  • You can infer from the returned timestamp the approximate time as to when this message was sent.
  • 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.

◆ GetText()

string agora_rtm.IMessage.GetText ( )
inline

Retrieves the content of the text message or the text description of the raw message.

Returns
The content of the text message or the text description of the raw message.

◆ IsOfflineMessage()

bool agora_rtm.IMessage.IsOfflineMessage ( )
inline

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

Deprecated:
This method is deprecated. Agora recommends that you do not use it.
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.
  • For now we only cache 200 offline messages for up to seven days for each receiver. When the number of the cached messages reaches this limit, the newest message overrides the oldest one.
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.

◆ Release()

void agora_rtm.IMessage.Release ( )
inlineprotected

Releases all resources used by the IMessage instance.

◆ SetMessagePtr()

void agora_rtm.IMessage.SetMessagePtr ( IntPtr  messagePtr)
inline

◆ SetText()

void agora_rtm.IMessage.SetText ( string  text)
inline

Sets the content of the text message or the text description of the raw message.

Parameters
textThe content of the text message or the text description of the raw message.

Member Data Documentation

◆ _IsOfflineMessage

bool agora_rtm.IMessage._IsOfflineMessage = false
protected

◆ _Length

int agora_rtm.IMessage._Length = 0

◆ _MessageFlag

MESSAGE_FLAG agora_rtm.IMessage._MessageFlag = MESSAGE_FLAG.RECEIVE
protected

◆ _MessageId

Int64 agora_rtm.IMessage._MessageId = 0
protected

◆ _MessagePtr

IntPtr agora_rtm.IMessage._MessagePtr = IntPtr.Zero
protected

◆ _MessageText

string agora_rtm.IMessage._MessageText = ""
protected

◆ _MessageType

MESSAGE_TYPE agora_rtm.IMessage._MessageType = MESSAGE_TYPE.MESSAGE_TYPE_UNDEFINED
protected

◆ _RawMessageData

byte [] agora_rtm.IMessage._RawMessageData = null
protected

◆ _Ts

Int64 agora_rtm.IMessage._Ts = 0
protected

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