Public Member Functions

abstract void join (ResultCallback< Void > resultCallback)
 
abstract void leave (ResultCallback< Void > resultCallback)
 
abstract void sendMessage (RtmMessage message, ResultCallback< Void > resultCallback)
 
abstract void sendMessage (RtmMessage message, SendMessageOptions options, ResultCallback< Void > resultCallback)
 
abstract void getMembers (ResultCallback< List< RtmChannelMember >> resultCallback)
 
abstract String getId ()
 
abstract void release ()
 

Detailed Description

Agora RTM channel methods.

Member Function Documentation

◆ join()

abstract void io.agora.rtm.RtmChannel.join ( ResultCallback< Void >  resultCallback)
abstract

Joins a channel.

Note You can only join a maximum of 20 RTM channels at the same time. When the number of the channels you join exceeds the limit, you receive the AgoraRtmJoinChannelErrorFailure error code.

Parameters
resultCallbackA ResultCallback object.

◆ leave()

abstract void io.agora.rtm.RtmChannel.leave ( ResultCallback< Void >  resultCallback)
abstract

Leaves a channel.

Parameters
resultCallbackA ResultCallback object.

◆ sendMessage() [1/2]

abstract void io.agora.rtm.RtmChannel.sendMessage ( RtmMessage  message,
ResultCallback< Void >  resultCallback 
)
abstract

Sends a message to all users in the channel.

Note You can send messages (channel and peer-to-peer messages taken together) at a maximum speed of 60 queries per second.

Parameters
messageThe message to be sent. See RtmMessage.
resultCallbackA ResultCallback object.

◆ sendMessage() [2/2]

abstract void io.agora.rtm.RtmChannel.sendMessage ( RtmMessage  message,
SendMessageOptions  options,
ResultCallback< Void >  resultCallback 
)
abstract

Sends a message to all users in the channel.

Note You can send messages (channel and peer-to-peer messages taken together) at a maximum speed of 60 queries per second.

Parameters
messageThe message to be sent. See RtmMessage.
optionsThe option of message to be send. See SendMessageOptions.
resultCallbackA ResultCallback object.

◆ getMembers()

abstract void io.agora.rtm.RtmChannel.getMembers ( ResultCallback< List< RtmChannelMember >>  resultCallback)
abstract

Retrieves the member list of the channel.

Note You can call this method at a maximum speed of five queries every two seconds.

Parameters
resultCallbackA ResultCallback object.

◆ getId()

abstract String io.agora.rtm.RtmChannel.getId ( )
abstract

Gets the channel ID.

Returns
The channel ID.

◆ release()

abstract void io.agora.rtm.RtmChannel.release ( )
abstract

Releases all resources of the current channel.

Note: Do not call this method in any of your callbacks.