Signaling (previously RTM) SDK v1.5.0 API Reference for Android
Public Member Functions | List of all members
io.agora.rtm.RtmChannel Class Referenceabstract

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
resultCallback A ResultCallback object.

◆ leave()

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

Leaves a channel.

Parameters
resultCallback A 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 For the RTM SDK for Android Java, you can send messages (channel and peer-to-peer messages taken together) at a maximum frequency of 180 calls every 3 seconds. For the RTM SDK for Linux Java, you can send messages (channel and peer-to-peer messages taken together) at a maximum frequency of 1500 calls every three seconds.

Parameters
message The message to be sent. See RtmMessage.
resultCallback A 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 For the RTM SDK for Android Java, you can send messages (channel and peer-to-peer messages taken together) at a maximum frequency of 180 calls every 3 seconds. For the RTM SDK for Linux Java, you can send messages (channel and peer-to-peer messages taken together) at a maximum frequency of 1500 calls every three seconds.

Parameters
message The message to be sent. See RtmMessage.
options The option of message to be send. See SendMessageOptions.
resultCallback A 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 frequency of five calls every two seconds. This method returns a maximum of 512 members. If the number of channel members exceed 512, the method returns 512 members randomly.

Parameters
resultCallback A 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.