AgoraChatSDK 1.3.1
Instance Methods | List of all members
<IAgoraChatContactManager> Protocol Reference

#import <IAgoraChatContactManager.h>

Inheritance diagram for <IAgoraChatContactManager>:

Instance Methods

(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:
 

Detailed Description

The contact management.

Method Documentation

◆ acceptInvitationForUsername:

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

Accepts a friend request.

This is a synchronous method and blocks the current thread.

Parameters
aUsernameThe user who initiated the friend request.
Returns
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.

Parameters
aUsernameThe user to add contact.
aMessage(optional) The invitation message. Sets the parameter as nil if you want to ignore the information.
Returns
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.

Parameters
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.

Parameters
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.

Parameters
aUsernameThe user to be added into the blocklist.
Returns
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.

Parameters
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.

Parameters
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.

Parameters
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.

Parameters
aUsernameThe user who initiates the friend request.
Returns
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.

Parameters
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.
Returns
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.

Parameters
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.

Returns
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.

Parameters
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.

Returns
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.

Parameters
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.

Parameters
pErrorThe error information if the method fails: Error.
Returns
The blocklist NSArray.

◆ getContact:

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

Gets contact by userId.

This is a synchronous method.

Parameters
userIdThe contact userId.
Returns
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.

Returns
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.

Parameters
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.

Parameters
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.

Parameters
pErrorThe error information if the method fails: Error.
Returns
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.

Parameters
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.

Parameters
pErrorThe error information if the method fails: Error.
Returns
The ID NSArray. See <NSString>.

◆ removeDelegate:

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

Removes delegate.

Parameters
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.

Parameters
aUsernameThe user to be removed from the blocklist.
Returns
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.

Parameters
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.

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

The documentation for this protocol was generated from the following file: