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 enableNotificationToChannelMembers as true. Also note that this flag is valid only within the current channel attribute method call.Occurs when the local user receives a channel message.
Occurs when the number of the channel members changes, and returns the new number.
Note
Occurs when a user joins a channel.
Note
This callback is disabled when the number of the channel members exceeds 512.Occurs when a user leaves the channel.
This callback is triggered when the user calls leave
to leave a channel or the user stays disconnected with the Agora RTM system for 30 seconds due to network issues.
Note
This callback is disabled when the number of the channel members exceeds 512.
Event types of the RtmChannel instance. In this interface, the function property’s name is the event name; the function property’s parameters is the parameters of the event listener function.
Listening to channel messages.
channel.on('ChannelMessage', function (message, memberId) { // Your code. });
Listening to events, such as a user joining the channel.
channel.on('MemberJoined', memberId => { // Your code. })
Listening to events, such as a member leaving the channel
channel.on('MemberLeft', memberId => { // Your code. });