HyphenateChatSDK 4.10.0
IEMContactManager.h
15#import <Foundation/Foundation.h>
16#import "EMCommonDefs.h"
17#import "EMContactManagerDelegate.h"
18#import "EMContact.h"
19#import "EMCursorResult.h"
20
21@class EMError;
22
30@protocol IEMContactManager <NSObject>
31
32@required
33
34#pragma mark - Delegate
35
49- (void)addDelegate:(id<EMContactManagerDelegate> _Nonnull)aDelegate
50 delegateQueue:(dispatch_queue_t)aQueue;
51
63- (void)removeDelegate:(id _Nonnull)aDelegate;
64
65
66#pragma mark - Contact Operations
67
83- (NSArray<NSString *> *_Nullable )getContacts;
84
100- (NSArray<EMContact*>* _Nullable)getAllContacts;
101
122- (void)setContactRemark:(NSString* _Nonnull)userId remark:(NSString*_Nullable)remark completion:(void (^_Nullable)(EMContact* _Nullable contact, EMError * _Nullable aError))aCompletionBlock;
123
142- (EMContact* _Nullable)getContact:(NSString* _Nonnull)userId;
143
160- (void)getAllContactsFromServerWithCompletion:(void (^_Nullable)(NSArray<EMContact *>* _Nullable aList, EMError* _Nullable aError))aCompletionBlock;
161
181- (void)getContactsFromServerWithCursor:(NSString* _Nullable)cursor pageSize:(NSUInteger)pageSize completion:(void (^_Nonnull)(EMCursorResult<EMContact*> * _Nullable aResult, EMError * _Nullable aError))aCompletionBlock;
182
183
200- (void)getContactsFromServerWithCompletion:(void (^)(NSArray<NSString *> *_Nullable aList, EMError *aError_Nullable ))aCompletionBlock;
201
221- (NSArray<NSString *> *_Nullable )getContactsFromServerWithError:(EMError **_Nullable )pError;
222
244- (EMError *_Nullable )addContact:(NSString *_Nonnull)aUsername
245 message:(NSString *_Nullable )aMessage;
246
267- (void)addContact:(NSString *_Nonnull)aUsername
268 message:(NSString *_Nullable )aMessage
269 completion:(void (^_Nullable )(NSString *_Nullable aUsername, EMError *_Nullable aError))aCompletionBlock;
270
292- (EMError *_Nullable )deleteContact:(NSString *_Nonnull)aUsername
293 isDeleteConversation:(BOOL)aIsDeleteConversation;
294
315- (void)deleteContact:(NSString *_Nonnull)aUsername
316 isDeleteConversation:(BOOL)aIsDeleteConversation
317 completion:(void (^_Nullable )(NSString *_Nullable aUsername, EMError *_Nullable aError))aCompletionBlock;
318
337- (void)approveFriendRequestFromUser:(NSString *_Nonnull)aUsername
338 completion:(void (^_Nullable )(NSString *_Nullable aUsername, EMError *_Nullable aError))aCompletionBlock;
339
358- (void)declineFriendRequestFromUser:(NSString *_Nonnull)aUsername
359 completion:(void (^_Nullable )(NSString *aUsername, EMError *_Nullable aError))aCompletionBlock;
360
361
362#pragma mark - Blacklist Operations
363
377- (NSArray<NSString *> *_Nullable )getBlackList;
378
395- (void)getBlackListFromServerWithCompletion:(void (^_Nullable )(NSArray<NSString *> *_Nullable aList, EMError *_Nullable aError))aCompletionBlock;
396
416- (NSArray<NSString *> *_Nullable )getBlackListFromServerWithError:(EMError **_Nullable )pError;
417
418
438- (EMError *_Nullable )addUserToBlackList:(NSString *_Nonnull)aUsername;
439
440
459- (void)addUserToBlackList:(NSString *_Nonnull)aUsername
460 completion:(void (^_Nullable )(NSString *_Nullable aUsername, EMError *_Nullable aError))aCompletionBlock;
461
481- (EMError *_Nullable )removeUserFromBlackList:(NSString *_Nonnull)aUsername;
482
501- (void)removeUserFromBlackList:(NSString *_Nonnull)aUsername
502 completion:(void (^_Nullable )(NSString *_Nullable aUsername, EMError *_Nullable aError))aCompletionBlock;
503
523- (EMError *_Nullable )acceptInvitationForUsername:(NSString *_Nonnull)aUsername;
524
549- (EMError *_Nullable )declineInvitationForUsername:(NSString *_Nonnull)aUsername;
550
551#pragma mark - Other platform
552
575- (NSArray<NSString *> *_Nullable )getSelfIdsOnOtherPlatformWithError:(EMError **_Nullable )pError;
576
595- (void)getSelfIdsOnOtherPlatformWithCompletion:(void (^_Nullable)(NSArray<NSString *> *_Nullable aList, EMError *_Nullable aError))aCompletionBlock;
596
597@end
Definition: EMContact.h:18
Definition: EMCursorResult.h:27
Definition: EMError.h:27
Definition: EMContactManagerDelegate.h:26
Definition: IEMContactManager.h:30
NSArray< EMContact * > *_Nullable getAllContacts()
NSArray< NSString * > *_Nullable getBlackList()
NSArray< NSString * > *_Nullable getContacts()