AVIMClientDelegate Protocol Reference

Conforms to NSObject
Declared in AVIMClient.h

Overview

The AVIMClientDelegate protocol defines methods to handle these events: connecting status changes, message comes and members of the conversation changes.

– imClientPaused: required method

Client Paused.

- (void)imClientPaused:(AVIMClient *)imClient

Parameters

imClient

imClient

Discussion

Client Paused.

Common Scenario:

  1. Network Unreachable

  2. iOS App in Background

  3. … …

Client will Auto Resuming if environment become Normal.

Declared In

AVIMClient.h

– imClientResuming: required method

Client is Resuming.

- (void)imClientResuming:(AVIMClient *)imClient

Parameters

imClient

imClient

Discussion

Client is Resuming.

Common Scenario:

  1. Network from Unreachable to Reachable

  2. iOS App from Background to Foreground

  3. … …

Client is Resuming the Session.

Declared In

AVIMClient.h

– imClientResumed: required method

Client is Resumed from Paused Status and now its Status is Opened.

- (void)imClientResumed:(AVIMClient *)imClient

Parameters

imClient

imClient

Discussion

Client is Resumed from Paused Status and now its Status is Opened.

Declared In

AVIMClient.h

– imClientClosed:error: required method

Client Closed with an Error and will not resume.

- (void)imClientClosed:(AVIMClient *)imClient error:(NSError *_Nullable)error

Parameters

imClient

imClient

error

Something Wrong

Discussion

Client Closed with an Error and will not resume.

Declared In

AVIMClient.h

– client:didOfflineWithError:

客户端下线通知。

- (void)client:(AVIMClient *)client didOfflineWithError:(NSError *_Nullable)error

Parameters

client

已下线的 client。

error

错误信息。

Discussion

客户端下线通知。

Declared In

AVIMClient.h

– conversation:didReceiveCommonMessage:

接收到新的普通消息。

- (void)conversation:(AVIMConversation *)conversation didReceiveCommonMessage:(AVIMMessage *)message

Parameters

conversation

- 所属对话

message
  • 具体的消息

Discussion

接收到新的普通消息。

Declared In

AVIMClient.h

– conversation:didReceiveTypedMessage:

接收到新的富媒体消息。

- (void)conversation:(AVIMConversation *)conversation didReceiveTypedMessage:(AVIMTypedMessage *)message

Parameters

conversation

- 所属对话

message
  • 具体的消息

Discussion

接收到新的富媒体消息。

Declared In

AVIMClient.h

– conversation:messageDelivered:

消息已投递给对方。

- (void)conversation:(AVIMConversation *)conversation messageDelivered:(AVIMMessage *)message

Parameters

conversation

- 所属对话

message
  • 具体的消息

Discussion

消息已投递给对方。

Declared In

AVIMClient.h

– conversation:messageHasBeenUpdated:

Callback which called when a message has been updated.

- (void)conversation:(AVIMConversation *)conversation messageHasBeenUpdated:(AVIMMessage *)message

Parameters

conversation

The conversation which the message belongs to.

message

The new message which has been updated.

Discussion

Callback which called when a message has been updated.

Declared In

AVIMClient.h

– conversation:membersAdded:byClientId:

对话中有新成员加入时所有成员都会收到这一通知。

- (void)conversation:(AVIMConversation *)conversation membersAdded:(NSArray<NSString*> *_Nullable)clientIds byClientId:(NSString *_Nullable)clientId

Parameters

conversation

- 所属对话

clientIds
  • 加入的新成员列表
clientId
  • 邀请者的 id

Discussion

对话中有新成员加入时所有成员都会收到这一通知。

Declared In

AVIMClient.h

– conversation:membersRemoved:byClientId:

对话中有成员离开时所有剩余成员都会收到这一通知。

- (void)conversation:(AVIMConversation *)conversation membersRemoved:(NSArray<NSString*> *_Nullable)clientIds byClientId:(NSString *_Nullable)clientId

Parameters

conversation

- 所属对话

clientIds
  • 离开的成员列表
clientId
  • 操作者的 id

Discussion

对话中有成员离开时所有剩余成员都会收到这一通知。

Declared In

AVIMClient.h

– conversation:invitedByClientId:

当前用户被邀请加入对话的通知。

- (void)conversation:(AVIMConversation *)conversation invitedByClientId:(NSString *_Nullable)clientId

Parameters

conversation

- 所属对话

clientId
  • 邀请者的 id

Discussion

当前用户被邀请加入对话的通知。

Declared In

AVIMClient.h

– conversation:kickedByClientId:

当前用户被踢出对话的通知。

- (void)conversation:(AVIMConversation *)conversation kickedByClientId:(NSString *_Nullable)clientId

Parameters

conversation

- 所属对话

clientId
  • 操作者的 id

Discussion

当前用户被踢出对话的通知。

Declared In

AVIMClient.h

– conversation:didUpdateForKey:

Notification for conversation property update. You can use this method to handle the properties that will be updated dynamicly during conversation’s lifetime, for example, unread message count, last message and receipt timestamp, etc.

- (void)conversation:(AVIMConversation *)conversation didUpdateForKey:(AVIMConversationUpdatedKey)key

Parameters

conversation

The updated conversation.

key

The property name of updated conversation.

Discussion

Notification for conversation property update. You can use this method to handle the properties that will be updated dynamicly during conversation’s lifetime, for example, unread message count, last message and receipt timestamp, etc.

Declared In

AVIMClient.h

– conversation:didUpdateAt:byClientId:updatedData:

Notification for conversation’s attribution updated.

- (void)conversation:(AVIMConversation *)conversation didUpdateAt:(NSDate *_Nullable)date byClientId:(NSString *_Nullable)clientId updatedData:(NSDictionary *_Nullable)data

Parameters

conversation

Updated conversation.

date

Updated date.

clientId

Client ID of doing updates.

data

Updated data.

Discussion

Notification for conversation’s attribution updated.

Declared In

AVIMClient.h

– conversation:didMemberInfoUpdateBy:memberId:role:

Notification for conversation’s member info updated.

- (void)conversation:(AVIMConversation *)conversation didMemberInfoUpdateBy:(NSString *_Nullable)byClientId memberId:(NSString *_Nullable)memberId role:(AVIMConversationMemberRole)role

Parameters

conversation

Updated conversation.

byClientId

Client ID of doing update.

memberId

Client ID of being updated.

role

Updated role.

Discussion

Notification for conversation’s member info updated.

Declared In

AVIMClient.h

– conversation:didBlockBy:

Notification for this client was blocked by other client in the conversation.

- (void)conversation:(AVIMConversation *)conversation didBlockBy:(NSString *_Nullable)byClientId

Parameters

conversation

Conversation.

byClientId

Who blocking this client.

Discussion

Notification for this client was blocked by other client in the conversation.

Declared In

AVIMClient.h

– conversation:didUnblockBy:

Notification for this client was Unblocked by other client in the conversation.

- (void)conversation:(AVIMConversation *)conversation didUnblockBy:(NSString *_Nullable)byClientId

Parameters

conversation

Conversation.

byClientId

Who unblocking this client.

Discussion

Notification for this client was Unblocked by other client in the conversation.

Declared In

AVIMClient.h

– conversation:didMembersBlockBy:memberIds:

Notification for some other clients was blocked by a client in the conversation.

- (void)conversation:(AVIMConversation *)conversation didMembersBlockBy:(NSString *_Nullable)byClientId memberIds:(NSArray<NSString*> *_Nullable)memberIds

Parameters

conversation

Conversation.

byClientId

Who blocking these clients.

memberIds

Being blocked clients’s ID array.

Discussion

Notification for some other clients was blocked by a client in the conversation.

Declared In

AVIMClient.h

– conversation:didMembersUnblockBy:memberIds:

Notification for some other clients was unblocked by a client in the conversation.

- (void)conversation:(AVIMConversation *)conversation didMembersUnblockBy:(NSString *_Nullable)byClientId memberIds:(NSArray<NSString*> *_Nullable)memberIds

Parameters

conversation

Conversation.

byClientId

Who unblocking these clients.

memberIds

Being unblocked clients’s ID array.

Discussion

Notification for some other clients was unblocked by a client in the conversation.

Declared In

AVIMClient.h

– conversation:didMuteBy:

Notification for this client was muted by other client in the conversation.

- (void)conversation:(AVIMConversation *)conversation didMuteBy:(NSString *_Nullable)byClientId

Parameters

conversation

Conversation.

byClientId

Who muting this client.

Discussion

Notification for this client was muted by other client in the conversation.

Declared In

AVIMClient.h

– conversation:didUnmuteBy:

Notification for this client was Unmuted by other client in the conversation.

- (void)conversation:(AVIMConversation *)conversation didUnmuteBy:(NSString *_Nullable)byClientId

Parameters

conversation

Conversation.

byClientId

Who unmuting this client.

Discussion

Notification for this client was Unmuted by other client in the conversation.

Declared In

AVIMClient.h

– conversation:didMembersMuteBy:memberIds:

Notification for some other clients was muted by a client in the conversation.

- (void)conversation:(AVIMConversation *)conversation didMembersMuteBy:(NSString *_Nullable)byClientId memberIds:(NSArray<NSString*> *_Nullable)memberIds

Parameters

conversation

Conversation.

byClientId

Who muted these clients.

memberIds

Being muted clients’s ID array.

Discussion

Notification for some other clients was muted by a client in the conversation.

Declared In

AVIMClient.h

– conversation:didMembersUnmuteBy:memberIds:

Notification for some other clients was unmuted by a client in the conversation.

- (void)conversation:(AVIMConversation *)conversation didMembersUnmuteBy:(NSString *_Nullable)byClientId memberIds:(NSArray<NSString*> *_Nullable)memberIds

Parameters

conversation

Conversation.

byClientId

Who unmuting these clients.

memberIds

Being unmuting clients’s ID array.

Discussion

Notification for some other clients was unmuted by a client in the conversation.

Declared In

AVIMClient.h

– imClientPaused:error:

当前聊天状态被暂停,常见于网络断开时触发。 注意:该回调会覆盖 imClientPaused: 方法。

- (void)imClientPaused:(AVIMClient *)imClient error:(NSError *)error

Parameters

imClient

相应的 imClient

error

具体错误信息

Discussion

当前聊天状态被暂停,常见于网络断开时触发。 注意:该回调会覆盖 imClientPaused: 方法。

Declared In

AVIMClient.h

– conversation:didReceiveUnread:

收到未读通知。在该终端上线的时候,服务器会将对话的未读数发送过来。未读数可通过 [AVIMConversation markAsReadInBackground] 清零,服务端不会自动清零。

- (void)conversation:(AVIMConversation *)conversation didReceiveUnread:(NSInteger)unread

Parameters

conversation

所属会话。

unread

未读消息数量。

Discussion

收到未读通知。在该终端上线的时候,服务器会将对话的未读数发送过来。未读数可通过 [AVIMConversation markAsReadInBackground] 清零,服务端不会自动清零。

Declared In

AVIMClient.h