agora_chat_SDK  3.8.2
Instance Methods | List of all members
<IAgoraContactManager> Protocol Reference

#import <IAgoraContactManager.h>

Inheritance diagram for <IAgoraContactManager>:

Instance Methods

(void) - addDelegate:delegateQueue:
 
(void) - removeDelegate:
 
(NSArray *) - getContacts
 
(void) - getContactsFromServerWithCompletion:
 
(NSArray *) - getContactsFromServerWithError:
 
(AgoraError *) - addContact:message:
 
(void) - addContact:message:completion:
 
(AgoraError *) - deleteContact:isDeleteConversation:
 
(void) - deleteContact:isDeleteConversation:completion:
 
(void) - approveFriendRequestFromUser:completion:
 
(void) - declineFriendRequestFromUser:completion:
 
(NSArray *) - getBlackList
 
(void) - getBlackListFromServerWithCompletion:
 
(NSArray *) - getBlackListFromServerWithError:
 
(AgoraError *) - addUserToBlackList:
 
(void) - addUserToBlackList:completion:
 
(AgoraError *) - removeUserFromBlackList:
 
(void) - removeUserFromBlackList:completion:
 
(AgoraError *) - acceptInvitationForUsername:
 
(AgoraError *) - declineInvitationForUsername:
 
(NSArray *) - getSelfIdsOnOtherPlatformWithError:
 
(void) - getSelfIdsOnOtherPlatformWithCompletion:
 
(AgoraError *) - addUserToBlackList:relationshipBoth:
 
(void) - addDelegate:
 
("Use -getContacts instead") - __deprecated_msg
 
("Use -getBlackList instead") - __deprecated_msg
 
(void) - asyncGetContactsFromServer:failure:
 
(void) - asyncAddContact:message:success:failure:
 
(AgoraError *) - deleteContact:
 
(void) - deleteContact:completion:
 
(void) - asyncDeleteContact:success:failure:
 
(void) - asyncGetBlackListFromServer:failure:
 
(void) - asyncAddUserToBlackList:relationshipBoth:success:failure:
 
(void) - asyncRemoveUserFromBlackList:success:failure:
 
(void) - asyncAcceptInvitationForUsername:success:failure:
 
(void) - asyncDeclineInvitationForUsername:success:failure:
 

Detailed Description

Contact Management

Method Documentation

- ("Use -getContacts instead") __deprecated_msg
required

Get all the friends from the DB

Returns
Contact NSArray<NSString>
- ("Use -getBlackList instead") __deprecated_msg
required

Get the blacklist from the DB

Returns
NSArray<NSString>
- (AgoraError *) acceptInvitationForUsername: (NSString *)  aUsername
required

Accept a friend request

Synchronization method will block the current thread

Parameters
aUsernameUser who initiated the friend request
Returns
Error
- (AgoraError *) addContact: (NSString *)  aUsername
message: (NSString *)  aMessage 
required

Add a contact with invitation message

Synchronization method will block the current thread

Parameters
aUsernameThe user to add
aMessage(optional) Invitation message. Pass in nil to ignore.
Returns
Error
- (void) addContact: (NSString *)  aUsername
message: (NSString *)  aMessage
completion: (void(^)(NSString *aUsername, AgoraError *aError))  aCompletionBlock 
required

Add a contact

Parameters
aUsernameThe user to be added
aMessageFriend request message
aCompletionBlockThe callback block of completion
- (void) addDelegate: (3_1_0) 
(3_2_2) 
("Use - instead")  EM_DEPRECATED_IOS[IAgoraContactManager addDelegate:delegateQueue:] 
required

Add delegate

Parameters
aDelegateDelegate
- (void) addDelegate: (id< AgoraContactManagerDelegate >)  aDelegate
delegateQueue: (dispatch_queue_t)  aQueue 
required

Add delegate

Parameters
aDelegateDelegate to be add
aQueue(optional) The queue of calling delegate methods. Pass in nil to run on main thread.
- (AgoraError *) addUserToBlackList: (NSString *)  aUsername
required

Add a user to blacklist

Synchronization method will block the current thread

Parameters
aUsernameBlock user
Returns
Error
- (void) addUserToBlackList: (NSString *)  aUsername
completion: (void(^)(NSString *aUsername, AgoraError *aError))  aCompletionBlock 
required

Add a user to blacklist

Parameters
aUsernameBlock user
aCompletionBlockThe callback block of completion
- (AgoraError *) addUserToBlackList: (NSString *)  aUsername
relationshipBoth: (3_2_3) 
(3_6_2) 
("Use - instead")  EM_DEPRECATED_IOS[IAgoraContactManager addUserToBlackList:] 
required

Add a user to blacklist

Synchronization method will block the current thread

Parameters
aUsernameBlock user
aBothif aBoth is YES, then hide user and block messages from blocked user; if NO, then hide user from blocked user
Returns
Error
- (void) approveFriendRequestFromUser: (NSString *)  aUsername
completion: (void(^)(NSString *aUsername, AgoraError *aError))  aCompletionBlock 
required

Apporove a friend request

Parameters
aUsernameUser who initiated the friend request
aCompletionBlockThe callback block of completion
- (void) asyncAcceptInvitationForUsername: (NSString *)  aUsername
success: (void(^)())  aSuccessBlock
failure: ("Use -approveFriendRequestFromUser:completion: instead")  __deprecated_msg 
required

Agree invitation

Parameters
aUsernameApplicant
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncAddContact: (NSString *)  aUsername
message: (NSString *)  aMessage
success: (void(^)())  aSuccessBlock
failure: ("Use -addContact:message:completion: instead")  __deprecated_msg 
required

Add a contact

Parameters
aUsernameThe user to add
aMessageFriend invitation message
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncAddUserToBlackList: (NSString *)  aUsername
relationshipBoth: (BOOL)  aBoth
success: (void(^)())  aSuccessBlock
failure: ("Use -addUserToBlackList:completion: instead")  __deprecated_msg 
required

Add user to blacklist

Parameters
aUsernameThe user to add
aBothWhether block messages from me to the user which is added to the black list
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncDeclineInvitationForUsername: (NSString *)  aUsername
success: (void(^)())  aSuccessBlock
failure: ("Use -declineFriendRequestFromUser:completion: instead")  __deprecated_msg 
required

Decline invitation

Parameters
aUsernameApplicant
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncDeleteContact: (NSString *)  aUsername
success: (void(^)())  aSuccessBlock
failure: ("Use -deleteContact:completion: instead")  __deprecated_msg 
required

Delete friend

Parameters
aUsernameThe user to be delete
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncGetBlackListFromServer: (void(^)(NSArray *aList))  aSuccessBlock
failure: ("Use -getBlackListFromServerWithCompletion: instead")  __deprecated_msg 
required

Get the blacklist from the server

Parameters
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncGetContactsFromServer: (void(^)(NSArray *aList))  aSuccessBlock
failure: ("Use -getContactsFromServerWithCompletion: instead")  __deprecated_msg 
required

Get all the friends from the server

Parameters
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncRemoveUserFromBlackList: (NSString *)  aUsername
success: (void(^)())  aSuccessBlock
failure: ("Use -removeUserFromBlackList:completion: instead")  __deprecated_msg 
required

Remove user from blacklist

Parameters
aUsernameThe user to remove from blacklist
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) declineFriendRequestFromUser: (NSString *)  aUsername
completion: (void(^)(NSString *aUsername, AgoraError *aError))  aCompletionBlock 
required

Decline a friend request

Parameters
aUsernameUser who initiated the friend request
aCompletionBlockThe callback block of completion
- (AgoraError *) declineInvitationForUsername: (NSString *)  aUsername
required

Decline a friend request

Synchronization method will block the current thread

Parameters
aUsernameUser who initiated the friend request
Returns
Error

Please use the new method

  • (void)declineFriendRequestFromUser:(NSString *)aUsername completion:(void (^)(NSString *aUsername, AgoraError *aError))aCompletionBlock;
- (AgoraError *) deleteContact: ("Use -deleteContact:username:isDeleteConversation: instead")  __deprecated_msg
required

Delete a contact

Synchronization method will block the current thread

Parameters
aUsernameThe user to delete
Returns
Error
- (void) deleteContact: (NSString *)  aUsername
completion: ("Use -deleteContact:username:isDeleteConversation: instead")  __deprecated_msg 
required

Delete a contact

Parameters
aUsernameThe user to be deleted
aCompletionBlockThe callback block of completion
- (AgoraError *) deleteContact: (NSString *)  aUsername
isDeleteConversation: (BOOL)  aIsDeleteConversation 
required

Delete a contact

Synchronization method will block the current thread

Parameters
aUsernameThe user to delete
aIsDeleteConversationwhether to keep the assoicated conversation and messages
Returns
Error
- (void) deleteContact: (NSString *)  aUsername
isDeleteConversation: (BOOL)  aIsDeleteConversation
completion: (void(^)(NSString *aUsername, AgoraError *aError))  aCompletionBlock 
required

Delete a contact

Parameters
aUsernameThe user to be deleted
aIsDeleteConversationDelete the conversation or not
aCompletionBlockThe callback block of completion
- (NSArray *) getBlackList
required

Get the blacklist of blocked users from local database

Returns
NSArray<NSString> blacklist usernames
- (void) getBlackListFromServerWithCompletion: (void(^)(NSArray *aList, AgoraError *aError))  aCompletionBlock
required

Get the blacklist from the server

Parameters
aCompletionBlockThe callback block of completion
Returns
aList<NSString> blacklist usernames
- (NSArray *) getBlackListFromServerWithError: (AgoraError **)  pError
required

Get the blacklist from the server

Synchronization method will block the current thread

Parameters
pErrorError
Returns
NSArray<NSString>
- (NSArray *) getContacts
required

Get all contacts from local database

Returns
Contact NSArray<NSString>
- (void) getContactsFromServerWithCompletion: (void(^)(NSArray *aList, AgoraError *aError))  aCompletionBlock
required

Get all contacts from the server

Parameters
aCompletionBlockThe callback block of completion
- (NSArray *) getContactsFromServerWithError: (AgoraError **)  pError
required

Get all the contacts from the server

Synchronization method will block the current thread

Parameters
pErrorError
Returns
Contact NSArray<NSString>
- (void) getSelfIdsOnOtherPlatformWithCompletion: (void(^)(NSArray *aList, AgoraError *aError))  aCompletionBlock
required

Get the id list of the current account on another platform (Windows or Web) Id usage is similar to friend username

Parameters
aCompletionBlockThe callback block of completion
- (NSArray *) getSelfIdsOnOtherPlatformWithError: (AgoraError **)  pError
required

Get the id list of the current account on another platform (Windows or Web) Id usage is similar to friend username

Parameters
pErrorError
Returns
NSArray<NSString>
- (void) removeDelegate: (id)  aDelegate
required

Remove delegate

Parameters
aDelegateDelegate
- (AgoraError *) removeUserFromBlackList: (NSString *)  aUsername
required

Remove user out of blacklist

Synchronization method will block the current thread

Parameters
aUsernameUnblock user
Returns
Error
- (void) removeUserFromBlackList: (NSString *)  aUsername
completion: (void(^)(NSString *aUsername, AgoraError *aError))  aCompletionBlock 
required

Remove a user from blacklist

Parameters
aUsernameUnblock user
aCompletionBlockThe callback block of completion

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