Agora RTC Objective-C API Reference  Refactor
Instance Methods
<AgoraRtmClientDelegate> Protocol Reference

Inherits <NSObjectNSObject>.

Instance Methods

(void) - rtmKit:onMessageEvent:
 
(void) - rtmKit:onPresenceEvent:
 
(void) - rtmKit:onUser:joinChannel:result:
 
(void) - rtmKit:onUser:leaveChannel:result:
 
(void) - rtmKit:onUser:joinTopic:inChannel:withMeta:result:
 
(void) - rtmKit:onUser:leaveTopic:inChannel:withMeta:result:
 
(void) - rtmKit:onUser:inTopic:inChannel:withSubscribeSuccess:withSubscribeFailed:result:
 
(void) - rtmKit:onUser:inTopic:inChannel:withUnsubscribeSuccess:withUnsubscribeFailed:result:
 
(void) - rtmKit:channel:connectionStateChanged:result:
 

Method Documentation

◆ rtmKit:onMessageEvent:

- (void) rtmKit: (AgoraRtmClientKit *_Nonnull)  rtmKit
onMessageEvent: (AgoraRtmMessageEvent *_Nonnull)  event 
optional

Occurs when receive a message.

Parameters
eventdetails of message event.

◆ rtmKit:onPresenceEvent:

- (void) rtmKit: (AgoraRtmClientKit *_Nonnull)  rtmKit
onPresenceEvent: (AgoraRtmPresenceEvent *_Nonnull)  event 
optional

Occurs when remote user join/leave channel, join/leave topic or local user joined channel.

note: When remote user join/leave channel will trigger this callback. When remote user(in same channel) joinTopic/destroy Topic will trigger this callback. When local user join channel will trigger this callback.

For type(AgoraRtmPresenceTypeRemoteJoinChannel/AgoraRtmPresenceTypeRemoteLeaveChannel), valid field will be channelType/type/channelName/userId For type(AgoraRtmPresenceTypeRemoteJoinTopic/AgoraRtmPresenceTypeRemoteLeaveTopic) valid field will be channelType/type/channelName/topicInfos/topicInfoNumber For type(AgoraRtmPresenceTypeSelfJoinChannel) valid field will be channelType/type/channelName/topicInfos/topicInfoNumber/userId

Parameters
eventdetails of presence event.

◆ rtmKit:onUser:joinChannel:result:

- (void) rtmKit: (AgoraRtmClientKit *_Nonnull)  rtmKit
onUser: (NSString *_Nonnull)  userId
joinChannel: (NSString *_Nonnull)  channelName
result: (AgoraRtmStreamChannelErrorCode errorCode 
optional

Occurs when user join a channel.

Parameters
channelNameThe Name of the channel.
userIdThe id of the user.
errorCodeThe error code.

◆ rtmKit:onUser:leaveChannel:result:

- (void) rtmKit: (AgoraRtmClientKit *_Nonnull)  rtmKit
onUser: (NSString *_Nonnull)  userId
leaveChannel: (NSString *_Nonnull)  channelName
result: (AgoraRtmStreamChannelErrorCode errorCode 
optional

Occurs when user leave a channel.

Parameters
channelNameThe Name of the channel.
userIdThe id of the user.
errorCodeThe error code.

◆ rtmKit:onUser:joinTopic:inChannel:withMeta:result:

- (void) rtmKit: (AgoraRtmClientKit *_Nonnull)  rtmKit
onUser: (NSString *_Nonnull)  userId
joinTopic: (NSString *_Nonnull)  topic
inChannel: (NSString *_Nonnull)  channelName
withMeta: (NSData *_Nullable)  meta
result: (AgoraRtmStreamChannelErrorCode errorCode 
optional

Occurs when user join topic.

Parameters
channelNameThe Name of the channel.
userIdThe id of the user.
topicThe name of the topic.
metaThe meta of the topic.
errorCodeThe error code.

◆ rtmKit:onUser:leaveTopic:inChannel:withMeta:result:

- (void) rtmKit: (AgoraRtmClientKit *_Nonnull)  rtmKit
onUser: (NSString *_Nonnull)  userId
leaveTopic: (NSString *_Nonnull)  topic
inChannel: (NSString *_Nonnull)  channelName
withMeta: (NSData *_Nullable)  meta
result: (AgoraRtmStreamChannelErrorCode errorCode 
optional

Occurs when user leave topic.

Parameters
channelNameThe Name of the channel.
userIdThe id of the user.
topicThe name of the topic.
metaThe meta of the topic.
errorCodeThe error code.

◆ rtmKit:onUser:inTopic:inChannel:withSubscribeSuccess:withSubscribeFailed:result:

- (void) rtmKit: (AgoraRtmClientKit *_Nonnull)  rtmKit
onUser: (NSString *_Nonnull)  userId
inTopic: (NSString *_Nonnull)  topic
inChannel: (NSString *_Nonnull)  channelName
withSubscribeSuccess: (NSArray< NSString * > *_Nonnull)  succeedUsers
withSubscribeFailed: (NSArray< NSString * > *_Nonnull)  failedUsers
result: (AgoraRtmStreamChannelErrorCode errorCode 
optional

Occurs when user subscribe topic.

Parameters
channelNameThe Name of the channel.
userIdThe id of the user.
topicThe name of the topic.
succeedUsersThe subscribed users.
failedUsersThe failed to subscribe users.
errorCodeThe error code.

◆ rtmKit:onUser:inTopic:inChannel:withUnsubscribeSuccess:withUnsubscribeFailed:result:

- (void) rtmKit: (AgoraRtmClientKit *_Nonnull)  rtmKit
onUser: (NSString *_Nonnull)  userId
inTopic: (NSString *_Nonnull)  topic
inChannel: (NSString *_Nonnull)  channelName
withUnsubscribeSuccess: (NSArray< NSString * > *_Nonnull)  succeedUsers
withUnsubscribeFailed: (NSArray< NSString * > *_Nonnull)  failedUsers
result: (AgoraRtmStreamChannelErrorCode errorCode 
optional

Occurs when user unsubscribe topic.

Parameters
channelNameThe Name of the channel.
userIdThe id of the user.
topicThe name of the topic.
succeedUsersThe unsubscribed users.
failedUsersThe failed to unsubscribe users.
errorCodeThe error code.

◆ rtmKit:channel:connectionStateChanged:result:

- (void) rtmKit: (AgoraRtmClientKit *_Nonnull)  kit
channel: (NSString *_Nonnull)  channelName
connectionStateChanged: (AgoraRtmClientConnectionState state
result: (AgoraRtmClientConnectionChangeReason reason 
optional

Occurs when the connection state changes between rtm sdk and agora service.

Parameters
channelNameThe Name of the channel.
stateThe new connection state.
reasonThe reason for the connection state change.