Adds or updates the attribute(s) of a specified channel.
This method updates the specified channel's attribute(s) if it finds that the attribute(s) has/have the same key(s), or adds attribute(s) to the channel if it does not.
Note
For setLocalUserAttributes, addOrUpdateChannelAttributes, deleteChannelAttributesByKeys, and clearChannelAttributes taken together: the call frequency limit is 10 queries every five seconds.The channel ID of the specified channel.
An array of channel attributes.
Options for this attribute operation. See ChannelAttributeOptions.
Adds or updates the local user's attribute(s).
This method updates the local user's attribute(s) if it finds that the attribute(s) has/have the same key(s), or adds attribute(s) to the local user if it does not.
The attributes to be added or updated.
The Promise resolves after successfully adding or updating the local user's attributes.
Clears all attributes of a specified channel.
Note
For RtmClient.setChannelAttributes, addOrUpdateChannelAttributes, deleteChannelAttributesByKeys, and clearChannelAttributes taken together: the call frequency limit is 10 queries every five seconds.The channel ID of the specified channel.
Options for this attribute operation. See ChannelAttributeOptions.
Clears all attributes of the local user.
The Promise resolves after successfully clearing the local user's attributes.
Creates an RtmChannel instance.
The unique channel name of the Agora RTM channel. The string length must be less than 64 bytes with the following character scope:
Note:
An RtmChannel instance.
Creates a LocalInvitation instance.
The uid of the callee.
A LocalInvitation instance.
Deletes the local user's attributes using attribute keys.
Note
For setLocalUserAttributes, addOrUpdateChannelAttributes, deleteChannelAttributesByKeys, and clearChannelAttributes taken together: the call frequency limit is 10 queries every five seconds.The channel ID of the specified channel.
A list of channel attribute keys.
Options for this attribute operation. See ChannelAttributeOptions.
Deletes the local user's attributes using attribute keys.
A list of the attribute keys to be deleted.
The Promise resolves after successfully deleting the local user's attributes.
Gets all attributes of a specified channel.
Note
For getChannelAttributes and getChannelAttributesByKeys taken together: the call frequency limit is 10 queries every five seconds.The ID of the specified channel.
Gets the attributes of a specified channel by attribute keys.
Note
For getChannelAttributes and getChannelAttributesByKeys taken together: the call frequency limit is 10 queries every five seconds.The ID of the specified channel.
An array of attribute keys.
Gets the member count of specified channel(s).
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.An array of the specified channel ID(s).
Gets all attributes of a specified user.
The user ID of the specified user.
Gets the attributes of a specified user by attribute keys.
The user ID of the specified user.
An array of the attribute keys.
Allows a user to log in the Agora RTM system.
An optional token generated by the app server.
The uid of the user logging in the Agora RTM system. The string length must be less than 64 bytes with the following character scope:
Note
number
type and recommend using the toString()
method to convert your non-string uid.The Promise resolves after the user logs in the Agora RTM system successfully.
Allows a user to log out of the Agora RTM system.
After the user logs out of the Agora RTM system, the SDK disconnects from the Agora RTM system and destroys the corresponding event listener.
The Promises resolves after the user logs out of the Agora RTM system and disconnects from WebSocket.
Adds the listener
function to the channel for the event named eventName
. See the EventEmitter
API documentation for other event methods on the RtmClient
instance.
The name of the RTM client event. See the property names in the RtmClientEvents for the list of events.
The callback function of the RTM client event.
Queries the online status of the specified user(s).
A list of the user IDs.
Renews the token.
Your new Token.
Allows a user to send an (offline) peer-to-peer message to a specified remote user.
You can send messages, including peer-to-peer and channel messages at a maximum speed of 60 queries per second.
The message to be sent.
The uid of the peer user.
Enables offline messaging. See SendMessageOptions.
Note
We do not support uids of thenumber
type. We recommend using the toString()
method to convert a non-string uid.
The Promise resolves after the message is successfully sent. The value of the resolve indicates whether the peer user is online and receives the message.
Sets the attributes of a specified channel with new ones.
Note
For setLocalUserAttributes, addOrUpdateChannelAttributes, deleteChannelAttributesByKeys, and clearChannelAttributes taken together: the call frequency limit is 10 queries every five seconds.The channel ID of the specified channel.
An array of channel attributes.
Options for this attribute operation. See ChannelAttributeOptions.
Substitutes the local user's attributes with new ones.
The new attributes.
The Promise resolves after successfully setting the local user's attributes.
Configures the SDK to provide technical preview functionalities or special customizations.
See RtmParameters.
RtmClient
is the entry point of the Agora RTM SDK. You can call the createInstance method of AgoraRTM to create anRtmClient
instance.