AgoraRtmChannelDelegate Protocol Reference
Conforms to | NSObject |
---|---|
Declared in | AgoraRtmKit.h |
Overview
The AgoraRtmChannelDelegate protocol enables callback event notifications to your app.
The SDK uses delegate callbacks in the AgoraRtmChannelDelegate protocol to report AgoraRtmChannelDelegate runtime events to the app.
– channel:memberJoined:
Occurs when a user joins the channel.
- (void)channel:(AgoraRtmChannel *_Nonnull)channel
memberJoined:(AgoraRtmMember *_Nonnull)member
Parameters
channel |
The channel that the user joins. See AgoraRtmChannel. |
---|---|
member |
The user joining the channel. See AgoraRtmMember. |
Discussion
When a remote user calls the joinWithCompletion 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.
Declared In
AgoraRtmKit.h
– channel:memberLeft:
Occurs when a channel member leaves the channel.
- (void)channel:(AgoraRtmChannel *_Nonnull)channel
memberLeft:(AgoraRtmMember *_Nonnull)member
Parameters
channel |
The channel that the user leaves. See AgoraRtmChannel. |
---|---|
member |
The channel member that leaves the channel. See AgoraRtmMember. |
Discussion
When a remote channel member calls the leaveWithCompletion 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.
Declared In
AgoraRtmKit.h
– channel:messageReceived:fromMember:
Occurs when receiving a channel message.
- (void)channel:(AgoraRtmChannel *_Nonnull)channel
messageReceived:(AgoraRtmMessage *_Nonnull)message
fromMember:(AgoraRtmMember *_Nonnull)member
Parameters
channel |
The channel, to which the local user belongs. See AgoraRtmChannel. |
---|---|
message |
The received channel message. See
AgoraRtmMessage.
Ensure that you check the |
member |
The message sender. See AgoraRtmMember. |
Discussion
When a remote channel member calls the sendMessage method and successfully sends out a channel message, the local user receives this callback.
Declared In
AgoraRtmKit.h
– channel:fileMessageReceived:fromMember:
DEPRECATED Deprecated as of v1.5.0. Agora recommends that you do not use it.
- (void)channel:(AgoraRtmChannel *_Nonnull)channel
fileMessageReceived:(AgoraRtmFileMessage *_Nonnull)message
fromMember:(AgoraRtmMember *_Nonnull)member
Parameters
channel |
The channel, to which the local user belongs. See AgoraRtmChannel. |
---|---|
message |
The received channel file message. See AgoraRtmFileMessage". |
member |
The message sender. See AgoraRtmMember. |
Discussion
Occurs when receiving a channel file message.
Declared In
AgoraRtmKit.h
– channel:imageMessageReceived:fromMember:
DEPRECATED Deprecated as of v1.5.0. Agora recommends that you do not use it.
- (void)channel:(AgoraRtmChannel *_Nonnull)channel
imageMessageReceived:(AgoraRtmImageMessage *_Nonnull)message
fromMember:(AgoraRtmMember *_Nonnull)member
Parameters
channel |
The channel, to which the local user belongs. See AgoraRtmChannel. |
---|---|
message |
The received channel image message. See AgoraRtmImageMessage. |
member |
The message sender. See AgoraRtmMember. |
Discussion
Occurs when receiving a channel image message.
Declared In
AgoraRtmKit.h
– channel:attributeUpdate:
Occurs when channel attributes are updated, and returns all attributes of the channel.
- (void)channel:(AgoraRtmChannel *_Nonnull)channel
attributeUpdate:(NSArray<AgoraRtmChannelAttribute*> *_Nonnull)attributes
Parameters
channel |
The channel, to which the local user belongs. See AgoraRtmChannel. |
---|---|
attributes |
An array of AgoraRtmChannelAttribute. See AgoraRtmChannelAttribute. |
Discussion
NOTE
This callback is enabled only when the user, who updates the attributes of the channel, sets enableNotificationToChannelMembers as YES. Also note that this flag is valid only within the current channel attribute method call.
Declared In
AgoraRtmKit.h
– channel:memberCount:
Occurs when the number of the channel members changes, and returns the new number.
- (void)channel:(AgoraRtmChannel *_Nonnull)channel
memberCount:(int)count
Parameters
channel |
The channel, to which the local user belongs. See AgoraRtmChannel. |
---|---|
count |
Member count of this channel. |
Discussion
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 and 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.
Declared In
AgoraRtmKit.h