AgoraChatSDK 1.3.1
IAgoraChatContactManager.h
9#import <Foundation/Foundation.h>
10#import "AgoraChatCommonDefs.h"
11#import "AgoraChatContactManagerDelegate.h"
12#import "AgoraChatContact.h"
13#import "AgoraChatCursorResult.h"
14
15@class AgoraChatError;
16
21@protocol IAgoraChatContactManager <NSObject>
22
23@required
24
25#pragma mark - Delegate
26
34- (void)addDelegate:(id<AgoraChatContactManagerDelegate> _Nonnull)aDelegate
35 delegateQueue:(dispatch_queue_t)aQueue;
36
43- (void)removeDelegate:(id _Nonnull)aDelegate;
44
45
46#pragma mark - Contact Operations
47
56- (NSArray<NSString *> *_Nullable )getContacts;
57
66- (NSArray<AgoraChatContact*>* _Nullable)getAllContacts;
67
79- (void)setContactRemark:(NSString* _Nonnull)userId remark:(NSString*_Nullable)remark completion:(void (^_Nullable)(AgoraChatContact* _Nullable contact, AgoraChatError * _Nullable aError))aCompletionBlock;
80
91- (AgoraChatContact* _Nullable)getContact:(NSString* _Nonnull)userId;
92
102- (void)getAllContactsFromServerWithCompletion:(void (^_Nullable)(NSArray<AgoraChatContact *>* _Nullable aList, AgoraChatError* _Nullable aError))aCompletionBlock;
103
115- (void)getContactsFromServerWithCursor:(NSString* _Nullable)cursor pageSize:(NSUInteger)pageSize completion:(void (^_Nonnull)(AgoraChatCursorResult<AgoraChatContact*> * _Nullable aResult, AgoraChatError * _Nullable aError))aCompletionBlock;
116
117
127- (void)getContactsFromServerWithCompletion:(void (^)(NSArray<NSString *> *_Nullable aList, AgoraChatError *aError_Nullable ))aCompletionBlock;
128
139- (NSArray<NSString *> *_Nullable )getContactsFromServerWithError:(AgoraChatError **_Nullable )pError;
140
152- (AgoraChatError *_Nullable )addContact:(NSString *_Nonnull)aUsername
153 message:(NSString *_Nullable )aMessage;
154
166- (void)addContact:(NSString *_Nonnull)aUsername
167 message:(NSString *_Nullable )aMessage
168 completion:(void (^_Nullable )(NSString *_Nullable aUsername, AgoraChatError *_Nullable aError))aCompletionBlock;
169
181- (AgoraChatError *_Nullable )deleteContact:(NSString *_Nonnull)aUsername
182 isDeleteConversation:(BOOL)aIsDeleteConversation;
183
195- (void)deleteContact:(NSString *_Nonnull)aUsername
196 isDeleteConversation:(BOOL)aIsDeleteConversation
197 completion:(void (^_Nullable )(NSString *_Nullable aUsername, AgoraChatError *_Nullable aError))aCompletionBlock;
198
209- (void)approveFriendRequestFromUser:(NSString *_Nonnull)aUsername
210 completion:(void (^_Nullable )(NSString *_Nullable aUsername, AgoraChatError *_Nullable aError))aCompletionBlock;
211
222- (void)declineFriendRequestFromUser:(NSString *_Nonnull)aUsername
223 completion:(void (^_Nullable )(NSString *aUsername, AgoraChatError *_Nullable aError))aCompletionBlock;
224
225
226#pragma mark - Blacklist Operations
227
234- (NSArray<NSString *> *_Nullable )getBlackList;
235
245- (void)getBlackListFromServerWithCompletion:(void (^_Nullable )(NSArray<NSString *> *_Nullable aList, AgoraChatError *_Nullable aError))aCompletionBlock;
246
257- (NSArray<NSString *> *_Nullable )getBlackListFromServerWithError:(AgoraChatError **_Nullable )pError;
258
259
270- (AgoraChatError *_Nullable )addUserToBlackList:(NSString *_Nonnull)aUsername;
271
272
283- (void)addUserToBlackList:(NSString *_Nonnull)aUsername
284 completion:(void (^_Nullable )(NSString *_Nullable aUsername, AgoraChatError *_Nullable aError))aCompletionBlock;
285
296- (AgoraChatError *_Nullable )removeUserFromBlackList:(NSString *_Nonnull)aUsername;
297
308- (void)removeUserFromBlackList:(NSString *_Nonnull)aUsername
309 completion:(void (^_Nullable )(NSString *_Nullable aUsername, AgoraChatError *_Nullable aError))aCompletionBlock;
310
321- (AgoraChatError *_Nullable )acceptInvitationForUsername:(NSString *_Nonnull)aUsername;
322
338- (AgoraChatError *_Nullable )declineInvitationForUsername:(NSString *_Nonnull)aUsername;
339
340#pragma mark - Other platform
341
354- (NSArray<NSString *> *_Nullable )getSelfIdsOnOtherPlatformWithError:(AgoraChatError **_Nullable )pError;
355
366- (void)getSelfIdsOnOtherPlatformWithCompletion:(void (^_Nullable)(NSArray<NSString *> *_Nullable aList, AgoraChatError *_Nullable aError))aCompletionBlock;
367
368@end
Definition: AgoraChatContact.h:15
Definition: AgoraChatCursorResult.h:16
Definition: AgoraChatError.h:18
Definition: AgoraChatContactManagerDelegate.h:17
Definition: IAgoraChatContactManager.h:21
NSArray< AgoraChatContact * > *_Nullable getAllContacts()
NSArray< NSString * > *_Nullable getContacts()
NSArray< NSString * > *_Nullable getBlackList()