ShengwangChatSDK 1.3.2
构造函数 | 所有成员列表
<IAgoraChatContactManager>协议 参考

#import <IAgoraChatContactManager.h>

类 <IAgoraChatContactManager> 继承关系图:

构造函数

(void) - addDelegate:delegateQueue:
 
(void) - removeDelegate:
 
(NSArray< NSString * > *_Nullable) - getContacts
 
(NSArray< AgoraChatContact * > *_Nullable) - getAllContacts
 
(void) - setContactRemark:remark:completion:
 
(AgoraChatContact *_Nullable) - getContact:
 
(void) - getAllContactsFromServerWithCompletion:
 
(void) - getContactsFromServerWithCursor:pageSize:completion:
 
(void) - getContactsFromServerWithCompletion:
 
(NSArray< NSString * > *_Nullable) - getContactsFromServerWithError:
 
(AgoraChatError *_Nullable) - addContact:message:
 
(void) - addContact:message:completion:
 
(AgoraChatError *_Nullable) - deleteContact:isDeleteConversation:
 
(void) - deleteContact:isDeleteConversation:completion:
 
(void) - approveFriendRequestFromUser:completion:
 
(void) - declineFriendRequestFromUser:completion:
 
(NSArray< NSString * > *_Nullable) - getBlackList
 
(void) - getBlackListFromServerWithCompletion:
 
(NSArray< NSString * > *_Nullable) - getBlackListFromServerWithError:
 
(AgoraChatError *_Nullable) - addUserToBlackList:
 
(void) - addUserToBlackList:completion:
 
(AgoraChatError *_Nullable) - removeUserFromBlackList:
 
(void) - removeUserFromBlackList:completion:
 
(AgoraChatError *_Nullable) - acceptInvitationForUsername:
 
(AgoraChatError *_Nullable) - declineInvitationForUsername:
 
(NSArray< NSString * > *_Nullable) - getSelfIdsOnOtherPlatformWithError:
 
(void) - getSelfIdsOnOtherPlatformWithCompletion:
 

详细描述

The contact management.

函数文档

◆ acceptInvitationForUsername:

- (AgoraChatError *_Nullable) acceptInvitationForUsername: (NSString *_Nonnull)  aUsername
required

Accepts a friend request.

This is a synchronous method and blocks the current thread.

参数
aUsernameThe user who initiated the friend request.
返回
The error information if the method fails: Error.

◆ addContact:message:

- (AgoraChatError *_Nullable) addContact: (NSString *_Nonnull)  aUsername
message: (NSString *_Nullable)  aMessage 
required

Adds a contact with invitation message.

This is a synchronous method and blocks the current thread.

参数
aUsernameThe user to add contact.
aMessage(optional) The invitation message. Sets the parameter as nil if you want to ignore the information.
返回
The error information if the method fails: Error.

◆ addContact:message:completion:

- (void) addContact: (NSString *_Nonnull)  aUsername
message: (NSString *_Nullable)  aMessage
completion: (void(^)(NSString *_Nullable aUsername, AgoraChatError *_Nullable aError))  aCompletionBlock 
required

Adds a contact.

This is an asynchronous method.

参数
aUsernameThe user to be added as a contact.
aMessageThe invitation message.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ addDelegate:delegateQueue:

- (void) addDelegate: (id< AgoraChatContactManagerDelegate > _Nonnull)  aDelegate
delegateQueue: (dispatch_queue_t)  aQueue 
required

Adds delegate.

参数
aDelegateThe delegate to be added.
aQueue(optional) The queue of calling delegate methods. You need to set this parameter as nil to run on main thread.

◆ addUserToBlackList:

- (AgoraChatError *_Nullable) addUserToBlackList: (NSString *_Nonnull)  aUsername
required

Adds a user to the blocklist.

This is a synchronous method and blocks the current thread.

参数
aUsernameThe user to be added into the blocklist.
返回
The error information if the method fails: Error.

◆ addUserToBlackList:completion:

- (void) addUserToBlackList: (NSString *_Nonnull)  aUsername
completion: (void(^)(NSString *_Nullable aUsername, AgoraChatError *_Nullable aError))  aCompletionBlock 
required

Adds a user to the blocklist.

This is an asynchronous method.

参数
aUsernameThe user to be added into the blocklist.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ approveFriendRequestFromUser:completion:

- (void) approveFriendRequestFromUser: (NSString *_Nonnull)  aUsername
completion: (void(^)(NSString *_Nullable aUsername, AgoraChatError *_Nullable aError))  aCompletionBlock 
required

Approves a friend request.

This is an asynchronous method.

参数
aUsernameThe user who initiated the friend request.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ declineFriendRequestFromUser:completion:

- (void) declineFriendRequestFromUser: (NSString *_Nonnull)  aUsername
completion: (void(^)(NSString *aUsername, AgoraChatError *_Nullable aError))  aCompletionBlock 
required

Declines a friend request.

This is an asynchronous method.

参数
aUsernameThe user who initiated the friend request.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ declineInvitationForUsername:

- (AgoraChatError *_Nullable) declineInvitationForUsername: (NSString *_Nonnull)  aUsername
required

Declines a friend request.

This is a synchronous method and blocks the current thread.

参数
aUsernameThe user who initiates the friend request.
返回
The error information if the method fails: Error.

Please use this new method.

  • (void)declineFriendRequestFromUser:(NSString *)aUsername completion:(void (^)(NSString *aUsername, AgoraChatError *aError))aCompletionBlock;

◆ deleteContact:isDeleteConversation:

- (AgoraChatError *_Nullable) deleteContact: (NSString *_Nonnull)  aUsername
isDeleteConversation: (BOOL)  aIsDeleteConversation 
required

Deletes a contact.

This is a synchronous method and blocks the current thread.

参数
aUsernameThe contact to be deleted.
aIsDeleteConversationWhether to keep the associated conversation and messages. Yes means delete the contact and synchronisely delete the conversations between the contact and the user. No means don't delete the conversations when deleting the contact.
返回
The error information if the method fails: Error.

◆ deleteContact:isDeleteConversation:completion:

- (void) deleteContact: (NSString *_Nonnull)  aUsername
isDeleteConversation: (BOOL)  aIsDeleteConversation
completion: (void(^)(NSString *_Nullable aUsername, AgoraChatError *_Nullable aError))  aCompletionBlock 
required

Deletes a contact.

This is an asynchronous method.

参数
aUsernameThe contact to be deleted.
aIsDeleteConversationWhether to delete the related conversation. Yes means delete the contact and synchronisely delete the conversations between the contact and the user. No means don't delete the conversations when deleting the contact.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ getAllContacts

- (NSArray< AgoraChatContact * > *_Nullable) getAllContacts
required

Gets all contacts from the local database␈.

This is a synchronous method and blocks the current thread.

返回
The contact NSArray.

◆ getAllContactsFromServerWithCompletion:

- (void) getAllContactsFromServerWithCompletion: (void(^)(NSArray< AgoraChatContact * > *_Nullable aList, AgoraChatError *_Nullable aError))  aCompletionBlock
required

Gets all contacts from the server.

This is an asynchronous method.

参数
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ getBlackList

- (NSArray< NSString * > *_Nullable) getBlackList
required

Gets the list of blocked users from local database. This is a synchronous method and blocks the current thread.

返回
The blocklist usernames NSArray. See <NSString>.

◆ getBlackListFromServerWithCompletion:

- (void) getBlackListFromServerWithCompletion: (void(^)(NSArray< NSString * > *_Nullable aList, AgoraChatError *_Nullable aError))  aCompletionBlock
required

Gets the blocklist from the server.

This is an asynchronous method.

参数
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ getBlackListFromServerWithError:

- (NSArray< NSString * > *_Nullable) getBlackListFromServerWithError: (AgoraChatError **_Nullable)  pError
required

Gets the blocklist from the server.

This is a synchronous method and blocks the current thread.

参数
pErrorThe error information if the method fails: Error.
返回
The blocklist NSArray.

◆ getContact:

- (AgoraChatContact *_Nullable) getContact: (NSString *_Nonnull)  userId
required

Gets contact by userId.

This is a synchronous method.

参数
userIdThe contact userId.
返回
The contact info of userId.

◆ getContacts

- (NSArray< NSString * > *_Nullable) getContacts
required

Gets all contacts from the local database␈.

This is a synchronous method and blocks the current thread.

返回
The contact NSArray.

◆ getContactsFromServerWithCompletion:

- (void) getContactsFromServerWithCompletion: (void(^)(NSArray< NSString * > *_Nullable aList, AgoraChatError *aError_Nullable))  aCompletionBlock
required

Gets all contacts from the server.

This is an asynchronous method.

参数
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ getContactsFromServerWithCursor:pageSize:completion:

- (void) getContactsFromServerWithCursor: (NSString *_Nullable)  cursor
pageSize: (NSUInteger)  pageSize
completion: (void(^)(AgoraChatCursorResult< AgoraChatContact * > *_Nullable aResult, AgoraChatError *_Nullable aError))  aCompletionBlock 
required

Gets all contacts from the server by page.

This is an asynchronous method.

参数
cursorcursor
pageSizepage size
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ getContactsFromServerWithError:

- (NSArray< NSString * > *_Nullable) getContactsFromServerWithError: (AgoraChatError **_Nullable)  pError
required

Gets all the contacts from the server.

This is a synchronous method and blocks the current thread.

参数
pErrorThe error information if the method fails: Error.
返回
The contact NSArray.

◆ getSelfIdsOnOtherPlatformWithCompletion:

- (void) getSelfIdsOnOtherPlatformWithCompletion: (void(^)(NSArray< NSString * > *_Nullable aList, AgoraChatError *_Nullable aError))  aCompletionBlock
required

Gets the ID list of the current account on another platform (Windows or Web) The ID usage is similar to friend username.

This is an asynchronous method.

参数
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ getSelfIdsOnOtherPlatformWithError:

- (NSArray< NSString * > *_Nullable) getSelfIdsOnOtherPlatformWithError: (AgoraChatError **_Nullable)  pError
required

Gets the ID list of the current account on another platform (Windows or Web) The ID usage is similar to friend username.

This is a synchronous method and blocks the current thread.

参数
pErrorThe error information if the method fails: Error.
返回
The ID NSArray. See <NSString>.

◆ removeDelegate:

- (void) removeDelegate: (id _Nonnull)  aDelegate
required

Removes delegate.

参数
aDelegateThe delegate to be removed.

◆ removeUserFromBlackList:

- (AgoraChatError *_Nullable) removeUserFromBlackList: (NSString *_Nonnull)  aUsername
required

Removes the user out of the blocklist.

This is a synchronous method and blocks the current thread.

参数
aUsernameThe user to be removed from the blocklist.
返回
The error information if the method fails: Error.

◆ removeUserFromBlackList:completion:

- (void) removeUserFromBlackList: (NSString *_Nonnull)  aUsername
completion: (void(^)(NSString *_Nullable aUsername, AgoraChatError *_Nullable aError))  aCompletionBlock 
required

Removes the user from the blocklist.

This is an asynchronous method.

参数
aUsernameThe user to be removed from the blocklist.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ setContactRemark:remark:completion:

- (void) setContactRemark: (NSString *_Nonnull)  userId
remark: (NSString *_Nullable)  remark
completion: (void(^)(AgoraChatContact *_Nullable contact, AgoraChatError *_Nullable aError))  aCompletionBlock 
required

Set remark for contact.

This is an asynchronous method.

参数
userIdThe contact userId.
remarkThe remark information.
aCompletionBlockThe completion block, which contains the error message if the method fails.

该协议的文档由以下文件生成: