Signaling (previously RTM) v1.4.8 API Reference for Unity
|
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 () |
|
inline |
create an RtmClient instance.
appId | The App ID issued to you from the Agora Console. Apply for a new App ID from Agora if it is missing from your kit. |
eventHandler | An RtmClientListener object that reports to the app on RTM SDK runtime events. |
|
inline |
Cancels an ongoing file or image download task by request ID.
The SDK returns the result of this method call with the OnMediaCancelResultHandler callback.
requestId | The unique ID of the download request to cancel. |
requestId | The unique ID of this download request. |
|
inline |
Cancels an ongoing file or image upload task by request ID.
The SDK returns the result of this method call with the OnMediaCancelResultHandler callback.
requestId | The unique ID of the upload request to cancel. |
|
inline |
Clears all attributes of a specified channel. The SDK returns the result by the OnClearChannelAttributesResultHandler callback.
channelId | The channel ID of the specified channel. |
enableNotificationToChannelMembers | Indicates whether or not to notify all channel members of a channel attribute change. |
requestId | The unique ID of this request. |
|
inline |
Clears all attributes of the local user. The SDK returns the result by the OnClearLocalUserAttributesResultHandler callback.
requestId | The unique ID of this request. |
|
inline |
Creates an Agora RTM channel.
null
.
channelId | The unique channel name. A channelId cannot be empty, null, or "null". Must be less than 64 bytes in length. Supported characters:
|
rtmChannelEventHandler | See RtmChannelEventHandler. |
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.channelId
is invalid or you have joined the maximum number of channels.
|
inline |
Creates an RtmChannelAttribute instance.
|
inline |
Creates an FileMessage instance by media ID.
mediaId | The media ID of an uploaded file on the Agora server. |
|
inline |
Gets an FileMessage instance by uploading a file to the Agora server.
The SDK returns the result with the OnFileMediaUploadResultHandler callback. If success, this callback returns a corresponding FileMessage instance.
filePath | The full path to the local file to upload. Must be in UTF-8. |
requestId | The unique ID of this upload request. |
|
inline |
Creates an ImageMessage instance by media ID.
mediaId | The media ID of an uploaded image on the Agora server. |
|
inline |
Gets an ImageMessage instance by uploading an image to the Agora server.
The SDK returns the result by the OnImageMediaUploadResultHandler callback. If success, this callback returns a corresponding ImageMessage instance.
filePath | The full path to the local image to upload. Must be in UTF-8. |
requestId | The unique ID of the upload request. |
|
inline |
Creates an empty TextMessage instance.
|
inline |
Creates a raw TextMessage instance.
rawData | The starting address of the raw message. |
|
inline |
Creates a raw TextMessage instance and sets its description.
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.rawData | The starting address of the raw message. |
description | A 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. |
|
inline |
Creates a text TextMessage instance.
text | The text content of the message. |
|
inline |
Deletes the attributes of a specified channel by attribute keys. The SDK returns the result by the OnDeleteChannelAttributesResultHandler callback.
channelId | The channel ID of the specified channel. |
attributeKeys | An array of channel attribute keys. |
enableNotificationToChannelMembers | Indicates whether or not to notify all channel members of a channel attribute change. |
requestId | The unique ID of this request. |
|
inline |
Deletes the local user's attributes by attribute keys. The SDK returns the result by the OnDeleteLocalUserAttributesResultHandler callback.
attributeKeys | An array of the attribute keys to be deleted. |
requestId | The unique ID of this request. |
|
inline |
|
inline |
Downloads a file or image from the Agora server to a specified local directory by media ID.
The SDK returns the result of this method call by the OnMediaDownloadToFileResultHandler callback.
mediaId | The media ID of the file or image on the Agora server. |
filePath | The full path to the downloaded file or image. Must be in UTF-8. |
requestId | The unique ID of this download request. |
|
inline |
Downloads a file or image from the Agora server to the local memory by media ID.
The SDK returns the result of this method call by the OnMediaDownloadToMemoryResultHandler callback.
mediaId | The media ID of the file or image on the Agora server. |
requestId | The unique ID of this download request. |
|
inline |
Gets all attributes of a specified channel. The SDK returns the result by the OnGetChannelAttributesResultHandler callback.
channelId | The channel ID of the specified channel. |
requestId | The unique ID of this request. |
|
inline |
Gets the attributes of a specified channel by attribute keys. The SDK returns the result by the OnGetChannelAttributesResultHandler callback.
channelId | The channel ID of the specified channel. |
attributeKeys | An array of attribute keys. |
requestId | The unique ID of this request. |
|
inline |
Gets the member count of specified channels. The SDK returns the result by the OnGetChannelMemberCountResultHandler callback.
channelIds | An array of the specified channel IDs. |
requestId | The unique ID of this request. |
|
inline |
Gets an RtmCallManager object. Each RtmClient object corresponds to a unique RtmCallManager object. That said, the RtmCallManager object is RtmClient-specific.
eventHandler | An RtmCallEventHandler object. |
|
inlinestatic |
Gets the SDK version.
|
inline |
Gets all attributes of a specified user. The SDK returns the result by the OnGetUserAttributesResultHandler callback.
userId | The user ID of the specified user. |
requestId | The unique ID of this request. |
|
inline |
Gets the attributes of a specified user by attribute keys. The SDK returns the result by the OnGetUserAttributesResultHandler callback.
userId | The user ID of the specified user. |
attributeKeys | An array of the attribute keys. |
requestId | The unique ID of this request. |
|
inline |
Logs in the Agora RTM system.
token | The 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. |
userId | The 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:
|
|
inline |
Logs out of the Agora RTM system. The local user receives the OnLogoutHandler callback.
|
inline |
Gets a list of the peers, to whose specific status you have subscribed. The SDK returns the result by the OnQueryPeersBySubscriptionOptionResultHandler callback.
option | The status type, to which you have subscribed. |
requestId | The unique ID of this request. |
|
inline |
Queries the online status of the specified users.
peerIds | An array of the specified user IDs. The maximum number of peerIds is 256. |
requestId | The unique ID of this request. |
|
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.
token | Your new RTM Token. You need to generate the RTM Token yourself. See Generate an RTM Token. |
|
inline |
peerId | User ID of the receiver. |
message | The message to be sent. For information about creating a message, see IMessage. |
|
inline |
Sends a peer-to-peer message to a specified user (receiver).
peerId |
|
message | The message to be sent. For information about creating a message, see IMessage. |
options | Options when sending the message to a peer. See SendMessageOptions. |
|
inline |
Resets the attributes of a specified channel. The SDK returns the result by the OnSetChannelAttributesResultHandler callback.
channelId | The channel ID of the specified channel. |
attributes | An array of channel attributes. See RtmChannelAttribute. |
options | Options for this attribute operation. See ChannelAttributeOptions. |
requestId | The unique ID of this request. |
|
inline |
Specifies the default path to the SDK log file.
logFilePath | The absolute file path to the log file. The string of logFilePath is in UTF-8. |
|
inline |
Sets the size of a single log file. The SDK has two log files with the same size.
fileSizeInKBytes | The size of a single log file (KB).The default is 10240 (KB). The value range is [512 KB, 1 GB]. |
|
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
.
fileter | The log filter level. |
|
inline |
Provides the technical preview functionalities or special customizations by configuring the SDK with JSON options.
parameters | SDK options in the JSON format. |
|
inline |
Subscribes to the online status of the specified users. The SDK returns the result by the OnSubscriptionRequestResultHandler callback.
peerIds | An array of the specified user IDs. |
requestId | The unique ID of this request. |
|
inline |
Unsubscribes from the online status of the specified users. The SDK returns the result by the OnSubscriptionRequestResultHandler callback.
peerIds | An array of the specified user IDs. |
requestId | The unique ID of this request. |