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

Public Member Functions

void  onMemberCountUpdated (int memberCount)
 
void  onAttributesUpdated (List< RtmChannelAttribute > attributeList)
 
void  onMessageReceived (RtmMessage message, RtmChannelMember fromMember)
 
void  onImageMessageReceived (RtmImageMessage message, RtmChannelMember fromMember)
 
void  onFileMessageReceived (RtmFileMessage message, RtmChannelMember fromMember)
 
void  onMemberJoined (RtmChannelMember member)
 
void  onMemberLeft (RtmChannelMember member)
 

Detailed Description

Callbacks for the Agora RTM channel methods.

Member Function Documentation

◆ onMemberCountUpdated()

void io.agora.rtm.RtmChannelListener.onMemberCountUpdated ( int  memberCount )

Occurs when the number of the channel members changes, and returns the new number.

Note

  • When the number of channel members ≤ 512, the SDK returns this callback when the number changes at the frequency of once per second.
  • When the number of channel members exceeds 512, the SDK returns this callback when the number changes at the frequency of once every three seconds.
  • You will receive this callback when successfully joining an RTM channel, so we recommend implementing this callback to receive timely updates on the number of the channel members.
Parameters
memberCount Member count of this channel.

◆ onAttributesUpdated()

void io.agora.rtm.RtmChannelListener.onAttributesUpdated ( List< RtmChannelAttribute attributeList )

Occurs when channel attributes are updated, and returns all attributes of the channel.

Note This callback is enabled only when the user, who updates the attributes of the channel, sets setEnableNotificationToChannelMembers as true. Also note that this flag is valid only within the current channel attribute method call.

Parameters
attributeList All attribute of this channel. See RtmChannelAttribute.

◆ onMessageReceived()

void io.agora.rtm.RtmChannelListener.onMessageReceived ( RtmMessage  message,
RtmChannelMember  fromMember 
)

Occurs when the local channel member receives a channel message.

When a remote channel member calls the sendMessage method and successfully sends out a channel message, the local channel member receives this callback.

Parameters
message The received channel message. See RtmMessage.
fromMember The message sender. See RtmChannelMember.

◆ onImageMessageReceived()

void io.agora.rtm.RtmChannelListener.onImageMessageReceived ( RtmImageMessage  message,
RtmChannelMember  fromMember 
)
Deprecated:
Deprecated as of v1.5.0. Agora recommends that you do not use it.

Occurs when the local channel member receives a channel image message.

Parameters
message The received channel image message. See RtmImageMessage.
fromMember The image message sender. See RtmChannelMember.

◆ onFileMessageReceived()

void io.agora.rtm.RtmChannelListener.onFileMessageReceived ( RtmFileMessage  message,
RtmChannelMember  fromMember 
)
Deprecated:
Deprecated as of v1.5.0. Agora recommends that you do not use it.

Occurs when the local channel member receives a channel file message.

Parameters
message The received channel file message. See RtmFileMessage.
fromMember The file message sender. See RtmChannelMember.

◆ onMemberJoined()

void io.agora.rtm.RtmChannelListener.onMemberJoined ( RtmChannelMember  member )

Occurs when a remote user joins the channel.

When a remote user calls the join method and successfully joins the channel, the local channel member receives this callback.

Note This callback is disabled when the number of the channel members exceeds 512.

Parameters
member The user that joins the channel. See RtmChannelMember.

◆ onMemberLeft()

void io.agora.rtm.RtmChannelListener.onMemberLeft ( RtmChannelMember  member )

Occurs when a remote channel member leaves the channel.

When a remote channel member calls the leave method and successfully leaves the channel, the local channel member receives this callback.

Note This callback is disabled when the number of the channel members exceeds 512.

Parameters
member The channel member that leaves the channel. See RtmChannelMember.