HyphenateSDK  3.6.1
IEMContactManager.h
1 
15 #import <Foundation/Foundation.h>
16 
17 #import "EMCommonDefs.h"
18 #import "EMContactManagerDelegate.h"
19 
20 @class EMError;
21 
29 @protocol IEMContactManager <NSObject>
30 
31 @required
32 
33 #pragma mark - Delegate
34 
48 - (void)addDelegate:(id<EMContactManagerDelegate>)aDelegate
49  delegateQueue:(dispatch_queue_t)aQueue;
50 
62 - (void)removeDelegate:(id)aDelegate;
63 
64 
65 #pragma mark - Contact Operations
66 
78 - (NSArray *)getContacts;
79 
92 - (void)getContactsFromServerWithCompletion:(void (^)(NSArray *aList, EMError *aError))aCompletionBlock;
93 
113 - (NSArray *)getContactsFromServerWithError:(EMError **)pError;
114 
136 - (EMError *)addContact:(NSString *)aUsername
137  message:(NSString *)aMessage;
138 
155 - (void)addContact:(NSString *)aUsername
156  message:(NSString *)aMessage
157  completion:(void (^)(NSString *aUsername, EMError *aError))aCompletionBlock;
158 
180 - (EMError *)deleteContact:(NSString *)aUsername
181  isDeleteConversation:(BOOL)aIsDeleteConversation;
182 
199 - (void)deleteContact:(NSString *)aUsername
200  isDeleteConversation:(BOOL)aIsDeleteConversation
201  completion:(void (^)(NSString *aUsername, EMError *aError))aCompletionBlock;
202 
217 - (void)approveFriendRequestFromUser:(NSString *)aUsername
218  completion:(void (^)(NSString *aUsername, EMError *aError))aCompletionBlock;
219 
234 - (void)declineFriendRequestFromUser:(NSString *)aUsername
235  completion:(void (^)(NSString *aUsername, EMError *aError))aCompletionBlock;
236 
237 
238 #pragma mark - Blacklist Operations
239 
251 - (NSArray *)getBlackList;
252 
266 - (void)getBlackListFromServerWithCompletion:(void (^)(NSArray *aList, EMError *aError))aCompletionBlock;
267 
287 - (NSArray *)getBlackListFromServerWithError:(EMError **)pError;
288 
310 - (EMError *)addUserToBlackList:(NSString *)aUsername
311  relationshipBoth:(BOOL)aBoth;
312 
327 - (void)addUserToBlackList:(NSString *)aUsername
328  completion:(void (^)(NSString *aUsername, EMError *aError))aCompletionBlock;
329 
349 - (EMError *)removeUserFromBlackList:(NSString *)aUsername;
350 
365 - (void)removeUserFromBlackList:(NSString *)aUsername
366  completion:(void (^)(NSString *aUsername, EMError *aError))aCompletionBlock;
367 
387 - (EMError *)acceptInvitationForUsername:(NSString *)aUsername;
388 
412 - (EMError *)declineInvitationForUsername:(NSString *)aUsername;
413 
414 #pragma mark - Other platform
415 
434 - (NSArray *)getSelfIdsOnOtherPlatformWithError:(EMError **)pError;
435 
450 - (void)getSelfIdsOnOtherPlatformWithCompletion:(void (^)(NSArray *aList, EMError *aError))aCompletionBlock;
451 
452 #pragma mark - EM_DEPRECATED_IOS 3.2.3
453 
465 - (void)addDelegate:(id<EMContactManagerDelegate>)aDelegate EM_DEPRECATED_IOS(3_1_0, 3_2_2, "Use -[IEMContactManager addDelegate:delegateQueue:]");
466 
467 #pragma mark - EM_DEPRECATED_IOS < 3.2.3
468 
480 - (NSArray *)getContactsFromDB __deprecated_msg("Use -getContacts");
481 
493 - (NSArray *)getBlackListFromDB __deprecated_msg("Use -getBlackList");
494 
509 - (void)asyncGetContactsFromServer:(void (^)(NSArray *aList))aSuccessBlock
510  failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -getContactsFromServerWithCompletion:");
511 
530 - (void)asyncAddContact:(NSString *)aUsername
531  message:(NSString *)aMessage
532  success:(void (^)())aSuccessBlock
533  failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -addContact:message:completion:");
534 
554 - (EMError *)deleteContact:(NSString *)aUsername __deprecated_msg("Use -deleteContact:username:isDeleteConversation:");
555 
556 
571 - (void)deleteContact:(NSString *)aUsername
572  completion:(void (^)(NSString *aUsername, EMError *aError))aCompletionBlock __deprecated_msg("Use -deleteContact:username:isDeleteConversation:");
573 
590 - (void)asyncDeleteContact:(NSString *)aUsername
591  success:(void (^)())aSuccessBlock
592  failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -deleteContact:completion:");
593 
608 - (void)asyncGetBlackListFromServer:(void (^)(NSArray *aList))aSuccessBlock
609  failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -getBlackListFromServerWithCompletion:");
610 
629 - (void)asyncAddUserToBlackList:(NSString *)aUsername
630  relationshipBoth:(BOOL)aBoth
631  success:(void (^)())aSuccessBlock
632  failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -addUserToBlackList:completion:");
633 
650 - (void)asyncRemoveUserFromBlackList:(NSString *)aUsername
651  success:(void (^)())aSuccessBlock
652  failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -removeUserFromBlackList:completion:");
653 
670 - (void)asyncAcceptInvitationForUsername:(NSString *)aUsername
671  success:(void (^)())aSuccessBlock
672  failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -approveFriendRequestFromUser:completion:");
673 
690 - (void)asyncDeclineInvitationForUsername:(NSString *)aUsername
691  success:(void (^)())aSuccessBlock
692  failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -declineFriendRequestFromUser:completion:");
693 @end
"Use -getContacts" __deprecated_msg()
Definition: EMError.h:26
Definition: IEMContactManager.h:29
NSArray * getBlackList()
Definition: EMContactManagerDelegate.h:26
NSArray * getContacts()