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

Inherits IDisposable.

Public Member Functions

 RtmClient (string appId, RtmClientEventHandler eventHandler)
 
int Login (string token, string userId)
 
int Logout ()
 
int RenewToken (string token)
 
int SendMessageToPeer (string peerId, IMessage message, SendMessageOptions options)
 
int SendMessageToPeer (string peerId, IMessage message)
 
int DownloadMediaToMemory (string mediaId, Int64 requestId)
 
int DownloadMediaToFile (string mediaId, string filePath, Int64 requestId)
 
int CancelMediaDownload (Int64 requestId)
 
int CancelMediaUpload (Int64 requestId)
 
RtmChannel CreateChannel (string channelId, RtmChannelEventHandler rtmChannelEventHandler)
 
TextMessage CreateMessage ()
 
TextMessage CreateMessage (string text)
 
TextMessage CreateMessage (byte[] rawData)
 
TextMessage CreateMessage (byte[] rawData, string description)
 
ImageMessage CreateImageMessageByMediaId (string mediaId)
 
int CreateImageMessageByUploading (string filePath, Int64 requestId)
 
FileMessage CreateFileMessageByMediaId (string mediaId)
 
int CreateFileMessageByUploading (string filePath, Int64 requestId)
 
RtmChannelAttribute CreateChannelAttribute ()
 
int SetParameters (string parameters)
 
int QueryPeersOnlineStatus (string[] peerIds, Int64 requestId)
 
int SubscribePeersOnlineStatus (string[] peerIds, Int64 requestId)
 
int UnsubscribePeersOnlineStatus (string[] peerIds, Int64 requestId)
 
int QueryPeersBySubscriptionOption (PEER_SUBSCRIPTION_OPTION option, Int64 requestId)
 
int SetLogFileSize (int fileSizeInKBytes)
 
int SetLogFilter (int fileter)
 
int SetLogFile (string logFilePath)
 
int GetChannelMemberCount (string[] channelIds, Int64 requestId)
 
int GetChannelAttributesByKeys (string channelId, string[] attributeKeys, Int64 requestId)
 
int GetChannelAttributes (string channelId, Int64 requestId)
 
int ClearChannelAttributes (string channelId, bool enableNotificationToChannelMembers, Int64 requestId)
 
int DeleteChannelAttributesByKeys (string channelId, string[] attributeKeys, bool enableNotificationToChannelMembers, Int64 requestId)
 
int GetUserAttributesByKeys (string userId, string[] attributeKeys, Int64 requestId)
 
int GetUserAttributes (string userId, Int64 requestId)
 
int ClearLocalUserAttributes (Int64 requestId)
 
int DeleteLocalUserAttributesByKeys (string[] attributeKeys, Int64 requestId)
 
int SetChannelAttributes (string channelId, RtmChannelAttribute[] attributes, ChannelAttributeOptions options, Int64 requestId)
 
RtmCallManager GetRtmCallManager (RtmCallEventHandler eventHandler)
 
void Dispose ()
 

Static Public Member Functions

static string GetSdkVersion ()
 

Constructor & Destructor Documentation

◆ RtmClient()

agora_rtm.RtmClient.RtmClient ( string  appId,
RtmClientEventHandler  eventHandler 
)
inline

create an RtmClient instance.

  • The Agora RTM SDK supports creating multiple RtmClient instances.
  • All methods in the RtmClient class are executed asynchronously.
Parameters
appIdThe App ID issued to you from the Agora Console. Apply for a new App ID from Agora if it is missing from your kit.
eventHandlerAn RtmClientListener object that reports to the app on RTM SDK runtime events.

Member Function Documentation

◆ CancelMediaDownload()

int agora_rtm.RtmClient.CancelMediaDownload ( Int64  requestId)
inline

Cancels an ongoing file or image download task by request ID.

Deprecated:
This method is deprecated. Agora recommends that you do not use it.

The SDK returns the result of this method call with the OnMediaCancelResultHandler callback.

Note
You can only cancel an ongoing download task. After a download task completes, the corresponding request ID is no longer valid and hence you cannot cancel it.
Parameters
requestIdThe unique ID of the download request to cancel.
requestIdThe unique ID of this download request.
Returns

◆ CancelMediaUpload()

int agora_rtm.RtmClient.CancelMediaUpload ( Int64  requestId)
inline

Cancels an ongoing file or image upload task by request ID.

Deprecated:
This method is deprecated. Agora recommends that you do not use it.

The SDK returns the result of this method call with the OnMediaCancelResultHandler callback.

Note
You can only cancel an ongoing upload task. After an upload task completes, you cannot cancel it and the corresponding request ID is no longer valid.
Parameters
requestIdThe unique ID of the upload request to cancel.
Returns

◆ ClearChannelAttributes()

int agora_rtm.RtmClient.ClearChannelAttributes ( string  channelId,
bool  enableNotificationToChannelMembers,
Int64  requestId 
)
inline

Clears all attributes of a specified channel. The SDK returns the result by the OnClearChannelAttributesResultHandler callback.

Note
Parameters
channelIdThe channel ID of the specified channel.
enableNotificationToChannelMembersIndicates whether or not to notify all channel members of a channel attribute change.
requestIdThe unique ID of this request.
Returns

◆ ClearLocalUserAttributes()

int agora_rtm.RtmClient.ClearLocalUserAttributes ( Int64  requestId)
inline

Clears all attributes of the local user. The SDK returns the result by the OnClearLocalUserAttributesResultHandler callback.

Note
For DeleteLocalUserAttributesByKeys and ClearLocalUserAttributes taken together: the maximum call frequency is 10 calls every five seconds.
Parameters
requestIdThe unique ID of this request.
Returns

◆ CreateChannel()

RtmChannel agora_rtm.RtmClient.CreateChannel ( string  channelId,
RtmChannelEventHandler  rtmChannelEventHandler 
)
inline

Creates an Agora RTM channel.

  • If the method call succeeds, the SDK returns an RtmChannel instance.
  • If this method call fails, the SDK returns null.
    Note
    You can create multiple channels in an RtmClient instance. But you can only join a maximum of 20 channels at the same time. As a good practice, Agora recommends calling the Dispose method to release all resources of an RTM channel that you no longer use.
Parameters
channelIdThe unique channel name. A channelId cannot be empty, null, or "null". Must be less than 64 bytes in length. Supported characters:
  • All lowercase English letters: a to z
  • All uppercase English letters: A to Z
  • All numeric characters: 0 to 9
  • The space character.
  • Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ","
rtmChannelEventHandlerSee RtmChannelEventHandler.
Returns
  • An RtmChannel object: Success. If a channel with the same channelId does not exist, the method returns the created channel instance. If a channel with the same channelId already exists, the method returns the existing channel instance.
  • null: Failure. Possible reasons: The channelId is invalid or you have joined the maximum number of channels.

◆ CreateChannelAttribute()

RtmChannelAttribute agora_rtm.RtmClient.CreateChannelAttribute ( )
inline

Creates an RtmChannelAttribute instance.

Returns
An RtmChannelAttribute instance.

◆ CreateFileMessageByMediaId()

FileMessage agora_rtm.RtmClient.CreateFileMessageByMediaId ( string  mediaId)
inline

Creates an FileMessage instance by media ID.

Deprecated:
This method is deprecated. Agora recommends that you do not use it.
  • If you have at hand the media ID of a file on the Agora server, you can call this method to create an FileMessage instance.
  • If you do not have a media ID, then you must call CreateFileMessageByUploading to get a corresponding FileMessage instance by uploading a file to the Agora RTM server.
Parameters
mediaIdThe media ID of an uploaded file on the Agora server.
Returns
An FileMessage instance.

◆ CreateFileMessageByUploading()

int agora_rtm.RtmClient.CreateFileMessageByUploading ( string  filePath,
Int64  requestId 
)
inline

Gets an FileMessage instance by uploading a file to the Agora server.

Deprecated:
This method is deprecated. Agora recommends that you do not use it.

The SDK returns the result with the OnFileMediaUploadResultHandler callback. If success, this callback returns a corresponding FileMessage instance.

Parameters
filePathThe full path to the local file to upload. Must be in UTF-8.
requestIdThe unique ID of this upload request.
Returns

◆ CreateImageMessageByMediaId()

ImageMessage agora_rtm.RtmClient.CreateImageMessageByMediaId ( string  mediaId)
inline

Creates an ImageMessage instance by media ID.

Deprecated:
This method is deprecated. Agora recommends that you do not use it.
  • If you have at hand the media ID of an image on the Agora server, you can call this method to create an ImageMessage instance.
  • If you do not have a media ID, then you must call CreateImageMessageByUploading to get a corresponding ImageMessage instance by uploading an image to the Agora RTM server.
Parameters
mediaIdThe media ID of an uploaded image on the Agora server.
Returns
An ImageMessage instance.

◆ CreateImageMessageByUploading()

int agora_rtm.RtmClient.CreateImageMessageByUploading ( string  filePath,
Int64  requestId 
)
inline

Gets an ImageMessage instance by uploading an image to the Agora server.

Deprecated:
This method is deprecated. Agora recommends that you do not use it.

The SDK returns the result by the OnImageMediaUploadResultHandler callback. If success, this callback returns a corresponding ImageMessage instance.

  • If the uploaded image is in JPEG, JPG, BMP, or PNG format, the SDK calculates the width and height of the image. You can call GetWidth to get the calculated width.
  • Otherwise, you need to call SetWidth and SetHeight to set the width and height of the uploaded image by yourself.
    Note
Parameters
filePathThe full path to the local image to upload. Must be in UTF-8.
requestIdThe unique ID of the upload request.
Returns

◆ CreateMessage() [1/4]

TextMessage agora_rtm.RtmClient.CreateMessage ( )
inline

Creates an empty TextMessage instance.

Note
  • An TextMessage instance can be used either for a channel message or for a peer-to-peer message.
  • When you no longer need an TextMessage instance, please call the Dispose method to release all resources that it is using.
  • You can set the content of the text message at a later point using the SetText method, but please ensure that the size of the text message does not exceed 32 KB.
Returns
An empty text TextMessage instance.

◆ CreateMessage() [2/4]

TextMessage agora_rtm.RtmClient.CreateMessage ( byte[]  rawData)
inline

Creates a raw TextMessage instance.

Note
  • An TextMessage instance can be used either for a channel message or for a peer-to-peer message.
  • When you no longer need an TextMessage instance, please call the Dispose method to release all resources that it is using.
  • You can set a brief text description of the raw message at a later point using the SetText method, but please ensure that the size of the raw message and the description combined does not exceed 32 KB.
Parameters
rawDataThe starting address of the raw message.
Returns
An raw TextMessage instance.

◆ CreateMessage() [3/4]

TextMessage agora_rtm.RtmClient.CreateMessage ( byte[]  rawData,
string  description 
)
inline

Creates a raw TextMessage instance and sets its description.

  • An TextMessage instance can be used either for a channel message or for a peer-to-peer message.
  • When you no longer need an TextMessage instance, please call the Dispose method to release all resources that it is using.
  • You can set description as "" and add a brief text description of the raw message at a later point using the SetText method, but please ensure that the size of the raw message and the description combined does not exceed 32 KB.
Parameters
rawDataThe starting address of the raw message.
descriptionA brief text description of the raw message. If you set a text description, ensure that the size of the raw message and the description combined does not exceed 32 KB.
Returns
An raw TextMessage instance with a brief text description.

◆ CreateMessage() [4/4]

TextMessage agora_rtm.RtmClient.CreateMessage ( string  text)
inline

Creates a text TextMessage instance.

Note
  • An TextMessage instance can be used either for a channel message or for a peer-to-peer message.
  • When you no longer need an TextMessage instance, please call the Dispose method to release all resources that it is using.
Parameters
textThe text content of the message.
Returns
An text TextMessage instance.

◆ DeleteChannelAttributesByKeys()

int agora_rtm.RtmClient.DeleteChannelAttributesByKeys ( string  channelId,
string[]  attributeKeys,
bool  enableNotificationToChannelMembers,
Int64  requestId 
)
inline

Deletes the attributes of a specified channel by attribute keys. The SDK returns the result by the OnDeleteChannelAttributesResultHandler callback.

Note
  • You do not have to join the specified channel to update its attributes.
  • The attributes of a channel will be cleared if the channel remains empty (has no members) for a couple of minutes.
  • If more than one user can update the channel attributes, then Agora recommends calling GetChannelAttributes to update the cache before calling this method.
  • For SetChannelAttributes, DeleteChannelAttributesByKeys and ClearChannelAttributes taken together: the maximum call frequency is 10 calls every five seconds.
Parameters
channelIdThe channel ID of the specified channel.
attributeKeysAn array of channel attribute keys.
enableNotificationToChannelMembersIndicates whether or not to notify all channel members of a channel attribute change.
requestIdThe unique ID of this request.
Returns

◆ DeleteLocalUserAttributesByKeys()

int agora_rtm.RtmClient.DeleteLocalUserAttributesByKeys ( string[]  attributeKeys,
Int64  requestId 
)
inline

Deletes the local user's attributes by attribute keys. The SDK returns the result by the OnDeleteLocalUserAttributesResultHandler callback.

Note
For DeleteLocalUserAttributesByKeys and ClearLocalUserAttributes taken together: the maximum call frequency is 10 calls every five seconds.
Parameters
attributeKeysAn array of the attribute keys to be deleted.
requestIdThe unique ID of this request.
Returns

◆ Dispose()

void agora_rtm.RtmClient.Dispose ( )
inline

◆ DownloadMediaToFile()

int agora_rtm.RtmClient.DownloadMediaToFile ( string  mediaId,
string  filePath,
Int64  requestId 
)
inline

Downloads a file or image from the Agora server to a specified local directory by media ID.

Deprecated:
This method is deprecated. Agora recommends that you do not use it.

The SDK returns the result of this method call by the OnMediaDownloadToFileResultHandler callback.

Parameters
mediaIdThe media ID of the file or image on the Agora server.
filePathThe full path to the downloaded file or image. Must be in UTF-8.
requestIdThe unique ID of this download request.
Returns

◆ DownloadMediaToMemory()

int agora_rtm.RtmClient.DownloadMediaToMemory ( string  mediaId,
Int64  requestId 
)
inline

Downloads a file or image from the Agora server to the local memory by media ID.

Deprecated:
This method is deprecated. Agora recommends that you do not use it.

The SDK returns the result of this method call by the OnMediaDownloadToMemoryResultHandler callback.

Note
  • This method applies to scenarios requiring quick access to the downloaded file or image.
  • The SDK releases the downloaded file or image immediately after returning the OnMediaDownloadToMemoryResultHandler callback.
Parameters
mediaIdThe media ID of the file or image on the Agora server.
requestIdThe unique ID of this download request.
Returns

◆ GetChannelAttributes()

int agora_rtm.RtmClient.GetChannelAttributes ( string  channelId,
Int64  requestId 
)
inline

Gets all attributes of a specified channel. The SDK returns the result by the OnGetChannelAttributesResultHandler callback.

Parameters
channelIdThe channel ID of the specified channel.
requestIdThe unique ID of this request.
Returns

◆ GetChannelAttributesByKeys()

int agora_rtm.RtmClient.GetChannelAttributesByKeys ( string  channelId,
string[]  attributeKeys,
Int64  requestId 
)
inline

Gets the attributes of a specified channel by attribute keys. The SDK returns the result by the OnGetChannelAttributesResultHandler callback.

Note
Parameters
channelIdThe channel ID of the specified channel.
attributeKeysAn array of attribute keys.
requestIdThe unique ID of this request.
Returns

◆ GetChannelMemberCount()

int agora_rtm.RtmClient.GetChannelMemberCount ( string[]  channelIds,
Int64  requestId 
)
inline

Gets the member count of specified channels. The SDK returns the result by the OnGetChannelMemberCountResultHandler callback.

Note
  • The call frequency limit for this method is one query per second.
  • We do not support getting the member counts of more than 32 channels in one method call.
  • You do not have to join the specified channels to call this method.
Parameters
channelIdsAn array of the specified channel IDs.
requestIdThe unique ID of this request.
Returns

◆ GetRtmCallManager()

RtmCallManager agora_rtm.RtmClient.GetRtmCallManager ( RtmCallEventHandler  eventHandler)
inline

Gets an RtmCallManager object. Each RtmClient object corresponds to a unique RtmCallManager object. That said, the RtmCallManager object is RtmClient-specific.

Note
When you do no use RtmCallManager, call the Dispose method to release all of its resources.
Parameters
eventHandlerAn RtmCallEventHandler object.
Returns
An RtmCallManager object.

◆ GetSdkVersion()

static string agora_rtm.RtmClient.GetSdkVersion ( )
inlinestatic

Gets the SDK version.

Returns
The current version of the Agora RTM SDK in the string format. For example, 1.0.0.

◆ GetUserAttributes()

int agora_rtm.RtmClient.GetUserAttributes ( string  userId,
Int64  requestId 
)
inline

Gets all attributes of a specified user. The SDK returns the result by the OnGetUserAttributesResultHandler callback.

Parameters
userIdThe user ID of the specified user.
requestIdThe unique ID of this request.
Returns

◆ GetUserAttributesByKeys()

int agora_rtm.RtmClient.GetUserAttributesByKeys ( string  userId,
string[]  attributeKeys,
Int64  requestId 
)
inline

Gets the attributes of a specified user by attribute keys. The SDK returns the result by the OnGetUserAttributesResultHandler callback.

Note
For GetUserAttributes and GetUserAttributesByKeys taken together, the maximum call frequency is 40 calls every five seconds.
Parameters
userIdThe user ID of the specified user.
attributeKeysAn array of the attribute keys.
requestIdThe unique ID of this request.
Returns

◆ Login()

int agora_rtm.RtmClient.Login ( string  token,
string  userId 
)
inline

Logs in the Agora RTM system.

Parameters
tokenThe token used to log in the Agora RTM system and used when dynamic authentication is enabled. Set token as null in the integration and test stages.
userIdThe user ID of the user logging in the Agora RTM system. The string length must be less than 64 bytes with the following character scope:
  • All lowercase English letters: a to z
  • All uppercase English letters: A to Z
  • All numeric characters: 0 to 9
  • The space character.
  • Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", "," A userId cannot be empty, null or "null".
Returns

◆ Logout()

int agora_rtm.RtmClient.Logout ( )
inline

Logs out of the Agora RTM system. The local user receives the OnLogoutHandler callback.

Returns

◆ QueryPeersBySubscriptionOption()

int agora_rtm.RtmClient.QueryPeersBySubscriptionOption ( PEER_SUBSCRIPTION_OPTION  option,
Int64  requestId 
)
inline

Gets a list of the peers, to whose specific status you have subscribed. The SDK returns the result by the OnQueryPeersBySubscriptionOptionResultHandler callback.

Parameters
optionThe status type, to which you have subscribed.
requestIdThe unique ID of this request.
Returns

◆ QueryPeersOnlineStatus()

int agora_rtm.RtmClient.QueryPeersOnlineStatus ( string[]  peerIds,
Int64  requestId 
)
inline

Queries the online status of the specified users.

  • Online: The user has logged in the Agora RTM system.
  • Offline: The user has logged out of the Agora RTM system.
    Note
    The frequency of calls is capped at 10 times every 5 seconds. The SDK returns the result by the OnQueryPeersOnlineStatusResultHandler callback.
Parameters
peerIdsAn array of the specified user IDs. The maximum number of peerIds is 256.
requestIdThe unique ID of this request.
Returns

◆ RenewToken()

int agora_rtm.RtmClient.RenewToken ( string  token)
inline

Renews the RTM Token of the SDK. You are required to renew your RTM Token when receiving the OnTokenExpiredHandler callback, and the OnRenewTokenResultHandler callback returns the result of this method call. The call frequency limit for this method is 2 calls per second.

Parameters
tokenYour new RTM Token. You need to generate the RTM Token yourself. See Generate an RTM Token.
Returns

◆ SendMessageToPeer() [1/2]

int agora_rtm.RtmClient.SendMessageToPeer ( string  peerId,
IMessage  message 
)
inline

Note
  • We do not recommend using this method to send a peer-to-peer message. Use SendMessageToPeer instead.
  • You can send messages, including peer-to-peer and channel messages, at a maximum frequency of 180 calls every three seconds.
Parameters
peerIdUser ID of the receiver.
messageThe message to be sent. For information about creating a message, see IMessage.
Returns

◆ SendMessageToPeer() [2/2]

int agora_rtm.RtmClient.SendMessageToPeer ( string  peerId,
IMessage  message,
SendMessageOptions  options 
)
inline

Sends a peer-to-peer message to a specified user (receiver).

  • The OnSendMessageResultHandler callback returns the result of this method call.
  • When the message arrives at the receiver, the receiver receives the OnMessageReceivedFromPeerHandler callback.
    Note
    • If you use this method to send off a text message that starts off with AGORA_RTM_ENDCALL_PREFIX_<channelId>_<your additional information>, then this method is compatible with the endCall method of the legacy Agora Signaling SDK. Replace <channelId> with the channel ID from which you want to leave (end call), and replace <your additional information> with any additional information.
    • You must not put any "_" (underscore" in your additional information but you can set \<your additional information\> as empty "".
Parameters
peerId
  • User ID of the receiver. The string must not exceed 64 bytes in length. It cannot be empty, null, or "null". Supported characters:
  • The 26 lowercase English letters: a to z
  • The 26 uppercase English letters: A to Z
  • The 10 numbers: 0 to 9
  • "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ","
messageThe message to be sent. For information about creating a message, see IMessage.
optionsOptions when sending the message to a peer. See SendMessageOptions.
Returns

◆ SetChannelAttributes()

int agora_rtm.RtmClient.SetChannelAttributes ( string  channelId,
RtmChannelAttribute[]  attributes,
ChannelAttributeOptions  options,
Int64  requestId 
)
inline

Resets the attributes of a specified channel. The SDK returns the result by the OnSetChannelAttributesResultHandler callback.

Note
  • You do not have to join the specified channel to update its attributes.
  • The attributes of a channel will be cleared if the channel remains empty (has no members) for a couple of minutes.
  • If more than one user can update the channel attributes, then Agora recommends calling GetChannelAttributes to update the cache before calling this method.
  • For DeleteLocalUserAttributesByKeys and ClearLocalUserAttributes taken together: the maximum call frequency is 10 calls every five seconds.
Parameters
channelIdThe channel ID of the specified channel.
attributesAn array of channel attributes. See RtmChannelAttribute.
optionsOptions for this attribute operation. See ChannelAttributeOptions.
requestIdThe unique ID of this request.
Returns

◆ SetLogFile()

int agora_rtm.RtmClient.SetLogFile ( string  logFilePath)
inline

Specifies the default path to the SDK log file.

Note
  • Ensure that the directory holding the log file exists and is writable.
  • Ensure that you call this method immediately after calling the RtmClient method to create a RtmClient instance, otherwise the output log may be incomplete.
  • This method is called globally. If multiple instances call this method, the last called method takes effect.
Parameters
logFilePathThe absolute file path to the log file. The string of logFilePath is in UTF-8.
Returns
  • 0: Success.
  • ≠0: Failure.

◆ SetLogFileSize()

int agora_rtm.RtmClient.SetLogFileSize ( int  fileSizeInKBytes)
inline

Sets the size of a single log file. The SDK has two log files with the same size.

Note
This method is called globally. If multiple instances call this method, the last called method takes effect.
Parameters
fileSizeInKBytesThe size of a single log file (KB).The default is 10240 (KB). The value range is [512 KB, 1 GB].
Returns
  • 0: Success.
  • ≠0: Failure.

◆ SetLogFilter()

int agora_rtm.RtmClient.SetLogFilter ( int  fileter)
inline

Sets the output log level of the SDK. You can use one or a combination of the filters. The log level follows the sequence of OFF, CRITICAL, ERROR, WARNING, and INFO. Choose a level to see the logs preceding that level. If, for example, you set the log level to WARNING, you see the logs within levels CRITICAL, ERROR, and WARNING.

Note
This method is called globally. If multiple instances call this method, the last called method takes effect.
Parameters
fileterThe log filter level.
Returns
  • 0: Success.
  • ≠0: Failure.

◆ SetParameters()

int agora_rtm.RtmClient.SetParameters ( string  parameters)
inline

Provides the technical preview functionalities or special customizations by configuring the SDK with JSON options.

Note
The JSON options are not public by default. Agora is working on making commonly used JSON options public in a standard way. Contact suppo.nosp@m.rt@a.nosp@m.gora..nosp@m.io for more information.
Parameters
parametersSDK options in the JSON format.
Returns
  • 0: Success.
  • ≠0: Failure.

◆ SubscribePeersOnlineStatus()

int agora_rtm.RtmClient.SubscribePeersOnlineStatus ( string[]  peerIds,
Int64  requestId 
)
inline

Subscribes to the online status of the specified users. The SDK returns the result by the OnSubscriptionRequestResultHandler callback.

  • When the method call succeeds, the SDK returns the OnPeersOnlineStatusChangedHandler callback to report the online status of peers, to whom you subscribe.
  • When the online status of the peers, to whom you subscribe, changes, the SDK returns the OnPeersOnlineStatusChangedHandler callback to report whose online status has changed.
  • If the online status of the peers, to whom you subscribe, changes when the SDK is reconnecting to the server, the SDK returns the OnPeersOnlineStatusChangedHandler callback to report whose online status has changed when successfully reconnecting to the server.
    Note
    • When you log out of the Agora RTM system, all the status that you subscribe to will be cleared. To keep the original subscription after you re-log in the system, you need to redo the whole subscription process.
    • When the SDK reconnects to the server from the state of being interupted, the SDK automatically subscribes to the peers and states before the interruption without human intervention.
Parameters
peerIdsAn array of the specified user IDs.
requestIdThe unique ID of this request.
Returns

◆ UnsubscribePeersOnlineStatus()

int agora_rtm.RtmClient.UnsubscribePeersOnlineStatus ( string[]  peerIds,
Int64  requestId 
)
inline

Unsubscribes from the online status of the specified users. The SDK returns the result by the OnSubscriptionRequestResultHandler callback.

Parameters
peerIdsAn array of the specified user IDs.
requestIdThe unique ID of this request.
Returns

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