HyphenateChatSDK 3.9.9.1
IEMChatroomManager.h
15#import <Foundation/Foundation.h>
16
17#import "EMCommonDefs.h"
18#import "EMChatroomManagerDelegate.h"
19#import "EMChatroomOptions.h"
20#import "EMChatroom.h"
21#import "EMPageResult.h"
22
23#import "EMCursorResult.h"
24
25@class EMError;
26
34@protocol IEMChatroomManager <NSObject>
35
36@required
37
38#pragma mark - Delegate
39
53- (void)addDelegate:(id<EMChatroomManagerDelegate> _Nonnull)aDelegate
54 delegateQueue:(dispatch_queue_t _Nullable)aQueue;
55
67- (void)removeDelegate:(id<EMChatroomManagerDelegate> _Nonnull)aDelegate;
68
69#pragma mark - Fetch Chatrooms
70
94- (EMPageResult<EMChatroom*> *_Nullable)getChatroomsFromServerWithPage:(NSInteger)aPageNum
95 pageSize:(NSInteger)aPageSize
96 error:(EMError **_Nullable)pError;
97
119- (void)getChatroomsFromServerWithPage:(NSInteger)aPageNum
120 pageSize:(NSInteger)aPageSize
121 completion:(void (^_Nullable)(EMPageResult<EMChatroom*> *_Nullable aResult, EMError *_Nullable aError))aCompletionBlock;
122
123#pragma mark - Create
124
154- (EMChatroom *_Nullable)createChatroomWithSubject:(NSString *_Nullable)aSubject
155 description:(NSString *_Nullable)aDescription
156 invitees:(NSArray<NSString *> *_Nullable)aInvitees
157 message:(NSString *_Nullable)aMessage
158 maxMembersCount:(NSInteger)aMaxMembersCount
159 error:(EMError **_Nullable)pError;
160
188- (void)createChatroomWithSubject:(NSString *_Nullable)aSubject
189 description:(NSString *_Nullable)aDescription
190 invitees:(NSArray<NSString *> *_Nullable)aInvitees
191 message:(NSString *_Nullable)aMessage
192 maxMembersCount:(NSInteger)aMaxMembersCount
193 completion:(void (^_Nullable)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
194
195#pragma mark - Edit Chatroom
196
218- (EMChatroom *)joinChatroom:(NSString * _Nonnull)aChatroomId
219 error:(EMError ** _Nullable)pError;
220
240- (void)joinChatroom:(NSString *_Nonnull)aChatroomId
241 completion:(void (^_Nullable)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
242
262- (void)leaveChatroom:(NSString *_Nonnull)aChatroomId
263 error:(EMError **_Nullable)pError;
264
284- (void)leaveChatroom:(NSString *_Nonnull)aChatroomId
285 completion:(void (^_Nullable)(EMError *_Nullable aError))aCompletionBlock;
286
312- (EMError *_Nullable)destroyChatroom:(NSString *_Nonnull)aChatroomId;
313
336- (void)destroyChatroom:(NSString *_Nonnull)aChatroomId
337 completion:(void (^_Nullable)(EMError * _Nullable aError))aCompletionBlock;
338
339#pragma mark - Fetch
340
362- (EMChatroom *_Nullable)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
363 error:(EMError *_Nullable*)pError;
364
383- (void)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
384 completion:(void (^_Nullable)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
385
406- (void)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
407 fetchMembers:(bool)aFetchMembers
408 completion:(void (^_Nullable)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
409
436- (EMCursorResult<NSString*> *_Nullable)getChatroomMemberListFromServerWithId:(NSString *_Nonnull)aChatroomId
437 cursor:(NSString *_Nullable)aCursor
438 pageSize:(NSInteger)aPageSize
439 error:(EMError **_Nullable)pError;
440
464- (void)getChatroomMemberListFromServerWithId:(NSString *_Nonnull)aChatroomId
465 cursor:(NSString *_Nullable)aCursor
466 pageSize:(NSInteger)aPageSize
467 completion:(void (^_Nullable)(EMCursorResult<NSString*> *_Nullable aResult, EMError *_Nullable aError))aCompletionBlock;
468
496- (NSArray<NSString *> *_Nullable)getChatroomBlacklistFromServerWithId:(NSString *_Nonnull)aChatroomId
497 pageNumber:(NSInteger)aPageNum
498 pageSize:(NSInteger)aPageSize
499 error:(EMError **_Nullable)pError;
500
528- (void)getChatroomBlacklistFromServerWithId:(NSString *_Nonnull)aChatroomId
529 pageNumber:(NSInteger)aPageNum
530 pageSize:(NSInteger)aPageSize
531 completion:(void (^_Nullable)(NSArray<NSString *> *_Nullable aList, EMError *_Nullable aError))aCompletionBlock;
532
560- (NSArray<NSString *> *_Nullable)getChatroomMuteListFromServerWithId:(NSString *_Nonnull)aChatroomId
561 pageNumber:(NSInteger)aPageNum
562 pageSize:(NSInteger)aPageSize
563 error:(EMError **_Nullable)pError;
564
592- (void)getChatroomMuteListFromServerWithId:(NSString *_Nonnull)aChatroomId
593 pageNumber:(NSInteger)aPageNum
594 pageSize:(NSInteger)aPageSize
595 completion:(void (^_Nullable)(NSArray<NSString *> *_Nullable aList, EMError *_Nullable aError))aCompletionBlock;
596
597
621- (NSArray<NSString *> *_Nullable)getChatroomWhiteListFromServerWithId:(NSString *_Nonnull)aChatroomId
622 error:(EMError **_Nullable)pError;
623
624
648- (void)getChatroomWhiteListFromServerWithId:(NSString *_Nonnull)aChatroomId
649 completion:(void (^_Nullable)(NSArray<NSString *> *_Nullable aList, EMError *_Nullable aError))aCompletionBlock;
650
670- (BOOL)isMemberInWhiteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
671 error:(EMError **_Nullable )pError;
672
692- (void)isMemberInWhiteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
693 completion:(void (^_Nullable)(BOOL inWhiteList, EMError *_Nullable aError))aCompletionBlock;
715- (NSString *_Nullable)getChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
716 error:(EMError **_Nullable )pError;
717
736- (void)getChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
737 completion:(void (^_Nullable)(NSString *_Nullable aAnnouncement, EMError *_Nullable aError))aCompletionBlock;
738
739#pragma mark - Edit
740
768- (EMChatroom *)updateSubject:(NSString *_Nullable )aSubject
769 forChatroom:(NSString *_Nonnull)aChatroomId
770 error:(EMError **_Nullable )pError;
771
797- (void)updateSubject:(NSString *_Nullable )aSubject
798 forChatroom:(NSString *_Nonnull)aChatroomId
799 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
800
828- (EMChatroom *_Nullable )updateDescription:(NSString *_Nullable )aDescription
829 forChatroom:(NSString *_Nonnull)aChatroomId
830 error:(EMError **_Nullable )pError;
831
857- (void)updateDescription:(NSString *_Nullable )aDescription
858 forChatroom:(NSString *_Nonnull)aChatroomId
859 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
860
888- (EMChatroom *_Nullable )removeMembers:(NSArray<NSString *> *_Nonnull)aMembers
889 fromChatroom:(NSString *_Nonnull)aChatroomId
890 error:(EMError **_Nullable )pError;
891
917- (void)removeMembers:(NSArray<NSString *> *_Nonnull)aMembers
918 fromChatroom:(NSString *_Nonnull)aChatroomId
919 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
920
948- (EMChatroom *_Nullable )blockMembers:(NSArray<NSString *> *_Nonnull)aMembers
949 fromChatroom:(NSString *_Nonnull)aChatroomId
950 error:(EMError **_Nullable )pError;
951
977- (void)blockMembers:(NSArray<NSString *> *_Nonnull)aMembers
978 fromChatroom:(NSString *_Nonnull)aChatroomId
979 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
980
981
1009- (EMChatroom *_Nullable )unblockMembers:(NSArray<NSString *> *_Nonnull)aMembers
1010 fromChatroom:(NSString *_Nonnull)aChatroomId
1011 error:(EMError **_Nullable )pError;
1012
1038- (void)unblockMembers:(NSArray<NSString *> *_Nonnull)aMembers
1039 fromChatroom:(NSString *_Nonnull)aChatroomId
1040 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1041
1069- (EMChatroom *_Nullable )updateChatroomOwner:(NSString *_Nonnull)aChatroomId
1070 newOwner:(NSString *_Nonnull)aNewOwner
1071 error:(EMError **_Nullable )pError;
1072
1098- (void)updateChatroomOwner:(NSString *_Nonnull)aChatroomId
1099 newOwner:(NSString *_Nonnull)aNewOwner
1100 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1101
1129- (EMChatroom *_Nullable )addAdmin:(NSString *_Nonnull)aAdmin
1130 toChatroom:(NSString *_Nonnull)aChatroomId
1131 error:(EMError **_Nullable )pError;
1132
1158- (void)addAdmin:(NSString *_Nonnull)aAdmin
1159 toChatroom:(NSString *_Nonnull)aChatroomId
1160 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroomp, EMError *_Nullable aError))aCompletionBlock;
1161
1189- (EMChatroom *_Nullable )removeAdmin:(NSString *_Nonnull)aAdmin
1190 fromChatroom:(NSString *_Nonnull)aChatroomId
1191 error:(EMError **_Nullable )pError;
1192
1218- (void)removeAdmin:(NSString *_Nonnull)aAdmin
1219 fromChatroom:(NSString *_Nonnull)aChatroomId
1220 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1221
1222
1252- (EMChatroom *_Nullable )muteMembers:(NSArray<NSString *> *_Nonnull)aMuteMembers
1253 muteMilliseconds:(NSInteger)aMuteMilliseconds
1254 fromChatroom:(NSString *_Nonnull)aChatroomId
1255 error:(EMError **_Nullable )pError;
1256
1283- (void)muteMembers:(NSArray<NSString *> *_Nonnull)aMuteMembers
1284 muteMilliseconds:(NSInteger)aMuteMilliseconds
1285 fromChatroom:(NSString *_Nonnull)aChatroomId
1286 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1287
1315- (EMChatroom *_Nullable )unmuteMembers:(NSArray<NSString *> *_Nonnull)aMembers
1316 fromChatroom:(NSString *_Nonnull)aChatroomId
1317 error:(EMError **_Nullable )pError;
1318
1343- (void)unmuteMembers:(NSArray<NSString *> *_Nonnull)aMembers
1344 fromChatroom:(NSString *_Nonnull)aChatroomId
1345 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1346
1347
1348
1374- (EMChatroom *_Nullable )muteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1375 error:(EMError **_Nullable )pError;
1376
1399- (void)muteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1400 completion:(void(^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1401
1402
1428- (EMChatroom *_Nullable )unmuteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1429 error:(EMError **_Nullable )pError;
1430
1431
1454- (void)unmuteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1455 completion:(void(^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1456
1457
1485- (EMChatroom *_Nullable )addWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1486 fromChatroom:(NSString *_Nonnull)aChatroomId
1487 error:(EMError **_Nullable )pError;
1488
1513- (void)addWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1514 fromChatroom:(NSString *_Nonnull)aChatroomId
1515 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1516
1544- (EMChatroom *_Nullable )removeWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1545 fromChatroom:(NSString *_Nonnull)aChatroomId
1546 error:(EMError **_Nullable )pError;
1547
1572- (void)removeWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1573 fromChatroom:(NSString *_Nonnull)aChatroomId
1574 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1575
1603- (EMChatroom *_Nullable )updateChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
1604 announcement:(NSString *_Nullable )aAnnouncement
1605 error:(EMError **_Nullable )pError;
1606
1631- (void)updateChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
1632 announcement:(NSString *_Nullable)aAnnouncement
1633 completion:(void (^_Nullable)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1666- (void)setChatroomAttributes:(NSString *_Nonnull)roomId attributes:(NSDictionary<NSString*,NSString*> *_Nonnull)keyValues autoDelete:(BOOL)autoDelete completionBlock:(void (^_Nullable)(EMError *_Nullable aError,NSDictionary<NSString*,EMError*> *_Nullable failureKeys))completionBlock ;
1710- (void)setChatroomAttribute:(NSString *_Nonnull)roomId key:(NSString *_Nonnull)key value:(NSString *_Nonnull)value autoDelete:(BOOL)autoDelete completionBlock:(void (^_Nullable)(EMError *_Nullable aError))completionBlock;
1736- (void)setChatroomAttributesForced:(NSString *_Nonnull)roomId attributes:(NSDictionary<NSString*,NSString*> *_Nonnull)keyValues autoDelete:(BOOL)autoDelete completionBlock:(void (^_Nullable)(EMError *_Nullable aError,NSDictionary<NSString*,EMError*> *_Nullable failureKeys))completionBlock;
1737
1781- (void)setChatroomAttributeForced:(NSString *_Nonnull)roomId key:(NSString *_Nonnull)key value:(NSString *_Nonnull)value autoDelete:(BOOL)autoDelete completionBlock:(void (^_Nullable)(EMError *_Nullable aError))completionBlock;
1782
1809- (void)removeChatroomAttributes:(NSString *_Nonnull)roomId attributes:(NSArray <__kindof NSString*> * _Nonnull)keyValues completionBlock:(void (^_Nullable)(EMError *_Nullable aError,NSDictionary<NSString*,EMError*> *_Nullable failureKeys))completionBlock;
1836- (void)removeChatroomAttribute:(NSString *_Nonnull)roomId key:(NSString * _Nonnull)key completionBlock:(void (^_Nullable)(EMError *_Nullable aError))completionBlock;
1863- (void)removeChatroomAttributesForced:(NSString *_Nonnull)roomId attributes:(NSArray <__kindof NSString*> * _Nonnull)keyValues completionBlock:(void (^_Nullable)(EMError *_Nullable aError,NSDictionary<NSString*,EMError*> *_Nullable failureKeys))completionBlock;
1864
1891- (void)removeChatroomAttributeForced:(NSString *_Nonnull)roomId key:(NSString * _Nonnull)key completionBlock:(void (^_Nullable)(EMError *_Nullable aError))completionBlock;
1910- (void)fetchChatroomAttributes:(NSString *_Nonnull)roomId keys:(NSArray <__kindof NSString *> * _Nullable)keys completion:(void (^_Nullable)(EMError *_Nullable aError,NSDictionary<NSString*,NSString*> *_Nullable properties ))completionBlock;
1927- (void)fetchChatroomAllAttributes:(NSString * _Nonnull)roomId completion:(void (^ _Nullable)(EMError * _Nullable error,NSDictionary<NSString*,NSString*> * _Nullable properties))completionBlock;
1928
1929#pragma mark - EM_DEPRECATED_IOS 3.3.0
1930
1958- (EMChatroom *)fetchChatroomInfo:(NSString *)aChatroomId
1959 includeMembersList:(BOOL)aIncludeMembersList
1960 error:(EMError **)pError EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -IEMChatroomManager getChatroomSpecificationFromServerWithId:error: instead");
1961
1982- (void)getChatroomSpecificationFromServerByID:(NSString *)aChatroomId
1983 includeMembersList:(BOOL)aIncludeMembersList
1984 completion:(void (^)(EMChatroom *aChatroom, EMError *aError))aCompletionBlock EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -IEMChatroomManager getChatroomSpecificationFromServerWithId:completion: instead");
1985
1986#pragma mark - EM_DEPRECATED_IOS 3.2.3
1987
2003- (void)addDelegate:(id<EMChatroomManagerDelegate>)aDelegate EM_DEPRECATED_IOS(3_1_0, 3_2_2, "Use -IEMChatroomManager addDelegate:delegateQueue: instead");
2004
2005#pragma mark - EM_DEPRECATED_IOS < 3.2.3
2006
2030- (NSArray *)getAllChatroomsFromServerWithError:(EMError **)pError __deprecated_msg("Use -getChatroomsFromServerWithPage instead");
2031
2048- (void)getAllChatroomsFromServerWithCompletion:(void (^)(NSArray *aList, EMError *aError))aCompletionBlock __deprecated_msg("Use -getChatroomsFromServerWithPage instead");
2049
2068- (void)asyncGetAllChatroomsFromServer:(void (^)(NSArray *aList))aSuccessBlock
2069 failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -getAllChatroomsFromServerWithCompletion: instead");
2070
2092- (void)asyncJoinChatroom:(NSString *)aChatroomId
2093 success:(void (^)(EMChatroom *aRoom))aSuccessBlock
2094 failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -joinChatroom:completion: instead");
2095
2119- (void)asyncLeaveChatroom:(NSString *)aChatroomId
2120 success:(void (^)(EMChatroom *aRoom))aSuccessBlock
2121 failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -leaveChatroom:completion: instead");
2122
2145- (void)asyncFetchChatroomInfo:(NSString *)aChatroomId
2146 includeMembersList:(BOOL)aIncludeMembersList
2147 success:(void (^)(EMChatroom *aChatroom))aSuccessBlock
2148 failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -getChatroomSpecificationFromServerByID:includeMembersList:completion: instead");
2149@end
Definition: EMChatroom.h:42
Definition: EMCursorResult.h:27
Definition: EMError.h:27
Definition: EMPageResult.h:24
Definition: EMChatroomManagerDelegate.h:41
Definition: IEMChatroomManager.h:34