Public Member Functions

void onMemberCountUpdated (int memberCount)
 
void onAttributesUpdated (List< RtmChannelAttribute > attributeList)
 
void onMessageReceived (RtmMessage 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 and at a MAXIMUM speed of once per second.
  • When the number of channel members exceeds 512, the SDK returns this callback when the number changes and at a MAXIMUM speed 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
memberCountMember 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
attributeListAll attribute of this channel. See RtmChannelAttribute.

◆ onMessageReceived()

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

Occurs when the local user receives a channel message.

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

Parameters
messageThe received channel message. See RtmMessage.
fromMemberThe 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 user receives this callback.

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

Parameters
memberThe user joining 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 user receives this callback.

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

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