Signaling (previously RTM) SDK v1.5.0 API Reference for Windows (C++)
Public Member Functions | List of all members
agora::rtm::IChannelEventHandler Class Reference

#include <IAgoraRtmService.h>

Public Member Functions

virtual  ~IChannelEventHandler ()
 
virtual void  onJoinSuccess ()
 
virtual void  onJoinFailure (JOIN_CHANNEL_ERR errorCode)
 
virtual void  onLeave (LEAVE_CHANNEL_ERR errorCode)
 
virtual void  onMessageReceived (const char *userId, const IMessage *message)
 
virtual void  onImageMessageReceived (const char *userId, const IImageMessage *message)
 
virtual void  onFileMessageReceived (const char *userId, const IFileMessage *message)
 
virtual void  onSendMessageResult (long long messageId, CHANNEL_MESSAGE_ERR_CODE state)
 
virtual void  onMemberJoined (IChannelMember *member)
 
virtual void  onMemberLeft (IChannelMember *member)
 
virtual void  onGetMembers (IChannelMember **members, int userCount, GET_MEMBERS_ERR errorCode)
 
virtual void  onAttributesUpdated (const IRtmChannelAttribute *attributes[], int numberOfAttributes)
 
virtual void  onMemberCountUpdated (int memberCount)
 

Constructor & Destructor Documentation

◆ ~IChannelEventHandler()

virtual agora::rtm::IChannelEventHandler::~IChannelEventHandler ( )
inlinevirtual

Member Function Documentation

◆ onJoinSuccess()

virtual void agora::rtm::IChannelEventHandler::onJoinSuccess ( )
inlinevirtual

Occurs when successfully joining a channel.

When the local user calls the join method and successfully joins the channel:

  • The SDK triggers this callback;
  • All remote users in the channel receive the onMemberJoined callback.

◆ onJoinFailure()

virtual void agora::rtm::IChannelEventHandler::onJoinFailure ( JOIN_CHANNEL_ERR  errorCode )
inlinevirtual

Occurs when failing to join a channel.

The local user receives this callback when the join method call fails.

Parameters
errorCode The error code. See JOIN_CHANNEL_ERR.

◆ onLeave()

virtual void agora::rtm::IChannelEventHandler::onLeave ( LEAVE_CHANNEL_ERR  errorCode )
inlinevirtual

Returns the result of the leave method call.

Parameters
errorCode The error code. See LEAVE_CHANNEL_ERR.

◆ onMessageReceived()

virtual void agora::rtm::IChannelEventHandler::onMessageReceived ( const char *  userId,
const IMessage message 
)
inlinevirtual

Occurs when receiving a channel message.

Parameters
userId The message sender.
message The received channel message. See IMessage.

◆ onImageMessageReceived()

virtual void agora::rtm::IChannelEventHandler::onImageMessageReceived ( const char *  userId,
const IImageMessage message 
)
inlinevirtual
Deprecated:
Deprecated as of v1.5.0. Agora recommends that you do not use it.

Occurs when receiving a channel image message.

Parameters
userId The message sender.
message The received channel image message. See IImageMessage.

◆ onFileMessageReceived()

virtual void agora::rtm::IChannelEventHandler::onFileMessageReceived ( const char *  userId,
const IFileMessage message 
)
inlinevirtual
Deprecated:
Deprecated as of v1.5.0. Agora recommends that you do not use it.

Occurs when receiving a channel file message.

Parameters
userId The message sender.
message The received channel file message. See IFileMessage.

◆ onSendMessageResult()

virtual void agora::rtm::IChannelEventHandler::onSendMessageResult ( long long  messageId,
CHANNEL_MESSAGE_ERR_CODE  state 
)
inlinevirtual

Returns the result of the sendMessage method call.

Parameters
messageId The ID of the sent channel message.
state The error codes. See CHANNEL_MESSAGE_ERR_CODE.

◆ onMemberJoined()

virtual void agora::rtm::IChannelEventHandler::onMemberJoined ( IChannelMember member )
inlinevirtual

Occurs when a remote user joins the channel.

When a remote user calls the join method and receives the onJoinSuccess callback (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
member The user joining the channel. See IChannelMember.

◆ onMemberLeft()

virtual void agora::rtm::IChannelEventHandler::onMemberLeft ( IChannelMember member )
inlinevirtual

Occurs when a remote member leaves the channel.

When a remote member in the channel calls the leave method and receives the the onLeave (LEAVE_CHANNEL_ERR_OK) callback, the local user 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 IChannelMember.

◆ onGetMembers()

virtual void agora::rtm::IChannelEventHandler::onGetMembers ( IChannelMember **  members,
int  userCount,
GET_MEMBERS_ERR  errorCode 
)
inlinevirtual

Returns the result of the getMembers method call.

When the method call succeeds, the SDK returns the member list of the channel.

Parameters
members The member list. See IChannelMember.
userCount The number of members.
errorCode Error code. See GET_MEMBERS_ERR.

◆ onAttributesUpdated()

virtual void agora::rtm::IChannelEventHandler::onAttributesUpdated ( const IRtmChannelAttribute attributes[],
int  numberOfAttributes 
)
inlinevirtual

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.
Parameters
attributes All attribute of this channel.
numberOfAttributes The total number of the channel attributes.

◆ onMemberCountUpdated()

virtual void agora::rtm::IChannelEventHandler::onMemberCountUpdated ( int  memberCount )
inlinevirtual

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 Agora recommends implementing this callback to receive timely updates on the number of the channel members.
Parameters
memberCount Member count of this channel.