HyphenateChatSDK 4.10.0
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
269- (void)joinChatroom:(NSString *_Nonnull)aChatroomId
270 ext:(NSString* _Nullable)ext
271 leaveOtherRooms:(BOOL)leaveOtherRooms
272 completion:(void (^_Nullable)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
273
293- (void)leaveChatroom:(NSString *_Nonnull)aChatroomId
294 error:(EMError **_Nullable)pError;
295
315- (void)leaveChatroom:(NSString *_Nonnull)aChatroomId
316 completion:(void (^_Nullable)(EMError *_Nullable aError))aCompletionBlock;
317
343- (EMError *_Nullable)destroyChatroom:(NSString *_Nonnull)aChatroomId;
344
367- (void)destroyChatroom:(NSString *_Nonnull)aChatroomId
368 completion:(void (^_Nullable)(EMError * _Nullable aError))aCompletionBlock;
369
370#pragma mark - Fetch
371
393- (EMChatroom *_Nullable)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
394 error:(EMError *_Nullable*)pError;
395
414- (void)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
415 completion:(void (^_Nullable)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
416
437- (void)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
438 fetchMembers:(bool)aFetchMembers
439 completion:(void (^_Nullable)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
440
467- (EMCursorResult<NSString*> *_Nullable)getChatroomMemberListFromServerWithId:(NSString *_Nonnull)aChatroomId
468 cursor:(NSString *_Nullable)aCursor
469 pageSize:(NSInteger)aPageSize
470 error:(EMError **_Nullable)pError;
471
495- (void)getChatroomMemberListFromServerWithId:(NSString *_Nonnull)aChatroomId
496 cursor:(NSString *_Nullable)aCursor
497 pageSize:(NSInteger)aPageSize
498 completion:(void (^_Nullable)(EMCursorResult<NSString*> *_Nullable aResult, EMError *_Nullable aError))aCompletionBlock;
499
527- (NSArray<NSString *> *_Nullable)getChatroomBlacklistFromServerWithId:(NSString *_Nonnull)aChatroomId
528 pageNumber:(NSInteger)aPageNum
529 pageSize:(NSInteger)aPageSize
530 error:(EMError **_Nullable)pError;
531
559- (void)getChatroomBlacklistFromServerWithId:(NSString *_Nonnull)aChatroomId
560 pageNumber:(NSInteger)aPageNum
561 pageSize:(NSInteger)aPageSize
562 completion:(void (^_Nullable)(NSArray<NSString *> *_Nullable aList, EMError *_Nullable aError))aCompletionBlock;
563
591- (NSArray<NSString *> *_Nullable)getChatroomMuteListFromServerWithId:(NSString *_Nonnull)aChatroomId
592 pageNumber:(NSInteger)aPageNum
593 pageSize:(NSInteger)aPageSize
594 error:(EMError **_Nullable)pError;
595
623- (void)getChatroomMuteListFromServerWithId:(NSString *_Nonnull)aChatroomId
624 pageNumber:(NSInteger)aPageNum
625 pageSize:(NSInteger)aPageSize
626 completion:(void (^_Nullable)(NSArray<NSString *> *_Nullable aList, EMError *_Nullable aError))aCompletionBlock;
627
628
652- (NSArray<NSString *> *_Nullable)getChatroomWhiteListFromServerWithId:(NSString *_Nonnull)aChatroomId
653 error:(EMError **_Nullable)pError;
654
655
679- (void)getChatroomWhiteListFromServerWithId:(NSString *_Nonnull)aChatroomId
680 completion:(void (^_Nullable)(NSArray<NSString *> *_Nullable aList, EMError *_Nullable aError))aCompletionBlock;
681
701- (BOOL)isMemberInWhiteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
702 error:(EMError **_Nullable )pError;
703
723- (void)isMemberInWhiteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
724 completion:(void (^_Nullable)(BOOL inWhiteList, EMError *_Nullable aError))aCompletionBlock;
725
745- (void)isMemberInMuteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
746 completion:(void (^_Nullable)(BOOL inMuteList, EMError *_Nullable aError))aCompletionBlock;
768- (NSString *_Nullable)getChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
769 error:(EMError **_Nullable )pError;
770
789- (void)getChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
790 completion:(void (^_Nullable)(NSString *_Nullable aAnnouncement, EMError *_Nullable aError))aCompletionBlock;
791
792#pragma mark - Edit
793
821- (EMChatroom *)updateSubject:(NSString *_Nullable )aSubject
822 forChatroom:(NSString *_Nonnull)aChatroomId
823 error:(EMError **_Nullable )pError;
824
850- (void)updateSubject:(NSString *_Nullable )aSubject
851 forChatroom:(NSString *_Nonnull)aChatroomId
852 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
853
881- (EMChatroom *_Nullable )updateDescription:(NSString *_Nullable )aDescription
882 forChatroom:(NSString *_Nonnull)aChatroomId
883 error:(EMError **_Nullable )pError;
884
910- (void)updateDescription:(NSString *_Nullable )aDescription
911 forChatroom:(NSString *_Nonnull)aChatroomId
912 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
913
941- (EMChatroom *_Nullable )removeMembers:(NSArray<NSString *> *_Nonnull)aMembers
942 fromChatroom:(NSString *_Nonnull)aChatroomId
943 error:(EMError **_Nullable )pError;
944
970- (void)removeMembers:(NSArray<NSString *> *_Nonnull)aMembers
971 fromChatroom:(NSString *_Nonnull)aChatroomId
972 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
973
1001- (EMChatroom *_Nullable )blockMembers:(NSArray<NSString *> *_Nonnull)aMembers
1002 fromChatroom:(NSString *_Nonnull)aChatroomId
1003 error:(EMError **_Nullable )pError;
1004
1030- (void)blockMembers:(NSArray<NSString *> *_Nonnull)aMembers
1031 fromChatroom:(NSString *_Nonnull)aChatroomId
1032 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1033
1034
1062- (EMChatroom *_Nullable )unblockMembers:(NSArray<NSString *> *_Nonnull)aMembers
1063 fromChatroom:(NSString *_Nonnull)aChatroomId
1064 error:(EMError **_Nullable )pError;
1065
1091- (void)unblockMembers:(NSArray<NSString *> *_Nonnull)aMembers
1092 fromChatroom:(NSString *_Nonnull)aChatroomId
1093 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1094
1122- (EMChatroom *_Nullable )updateChatroomOwner:(NSString *_Nonnull)aChatroomId
1123 newOwner:(NSString *_Nonnull)aNewOwner
1124 error:(EMError **_Nullable )pError;
1125
1151- (void)updateChatroomOwner:(NSString *_Nonnull)aChatroomId
1152 newOwner:(NSString *_Nonnull)aNewOwner
1153 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1154
1182- (EMChatroom *_Nullable )addAdmin:(NSString *_Nonnull)aAdmin
1183 toChatroom:(NSString *_Nonnull)aChatroomId
1184 error:(EMError **_Nullable )pError;
1185
1211- (void)addAdmin:(NSString *_Nonnull)aAdmin
1212 toChatroom:(NSString *_Nonnull)aChatroomId
1213 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroomp, EMError *_Nullable aError))aCompletionBlock;
1214
1242- (EMChatroom *_Nullable )removeAdmin:(NSString *_Nonnull)aAdmin
1243 fromChatroom:(NSString *_Nonnull)aChatroomId
1244 error:(EMError **_Nullable )pError;
1245
1271- (void)removeAdmin:(NSString *_Nonnull)aAdmin
1272 fromChatroom:(NSString *_Nonnull)aChatroomId
1273 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1274
1275
1305- (EMChatroom *_Nullable )muteMembers:(NSArray<NSString *> *_Nonnull)aMuteMembers
1306 muteMilliseconds:(NSInteger)aMuteMilliseconds
1307 fromChatroom:(NSString *_Nonnull)aChatroomId
1308 error:(EMError **_Nullable )pError;
1309
1336- (void)muteMembers:(NSArray<NSString *> *_Nonnull)aMuteMembers
1337 muteMilliseconds:(NSInteger)aMuteMilliseconds
1338 fromChatroom:(NSString *_Nonnull)aChatroomId
1339 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1340
1368- (EMChatroom *_Nullable )unmuteMembers:(NSArray<NSString *> *_Nonnull)aMembers
1369 fromChatroom:(NSString *_Nonnull)aChatroomId
1370 error:(EMError **_Nullable )pError;
1371
1396- (void)unmuteMembers:(NSArray<NSString *> *_Nonnull)aMembers
1397 fromChatroom:(NSString *_Nonnull)aChatroomId
1398 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1399
1400
1401
1427- (EMChatroom *_Nullable )muteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1428 error:(EMError **_Nullable )pError;
1429
1452- (void)muteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1453 completion:(void(^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1454
1455
1481- (EMChatroom *_Nullable )unmuteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1482 error:(EMError **_Nullable )pError;
1483
1484
1507- (void)unmuteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1508 completion:(void(^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1509
1510
1538- (EMChatroom *_Nullable )addWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1539 fromChatroom:(NSString *_Nonnull)aChatroomId
1540 error:(EMError **_Nullable )pError;
1541
1566- (void)addWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1567 fromChatroom:(NSString *_Nonnull)aChatroomId
1568 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1569
1597- (EMChatroom *_Nullable )removeWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1598 fromChatroom:(NSString *_Nonnull)aChatroomId
1599 error:(EMError **_Nullable )pError;
1600
1625- (void)removeWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1626 fromChatroom:(NSString *_Nonnull)aChatroomId
1627 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1628
1656- (EMChatroom *_Nullable )updateChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
1657 announcement:(NSString *_Nullable )aAnnouncement
1658 error:(EMError **_Nullable )pError;
1659
1684- (void)updateChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
1685 announcement:(NSString *_Nullable)aAnnouncement
1686 completion:(void (^_Nullable)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1719- (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 ;
1763- (void)setChatroomAttribute:(NSString *_Nonnull)roomId key:(NSString *_Nonnull)key value:(NSString *_Nonnull)value autoDelete:(BOOL)autoDelete completionBlock:(void (^_Nullable)(EMError *_Nullable aError))completionBlock;
1789- (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;
1790
1834- (void)setChatroomAttributeForced:(NSString *_Nonnull)roomId key:(NSString *_Nonnull)key value:(NSString *_Nonnull)value autoDelete:(BOOL)autoDelete completionBlock:(void (^_Nullable)(EMError *_Nullable aError))completionBlock;
1835
1862- (void)removeChatroomAttributes:(NSString *_Nonnull)roomId attributes:(NSArray <__kindof NSString*> * _Nonnull)keyValues completionBlock:(void (^_Nullable)(EMError *_Nullable aError,NSDictionary<NSString*,EMError*> *_Nullable failureKeys))completionBlock;
1889- (void)removeChatroomAttribute:(NSString *_Nonnull)roomId key:(NSString * _Nonnull)key completionBlock:(void (^_Nullable)(EMError *_Nullable aError))completionBlock;
1916- (void)removeChatroomAttributesForced:(NSString *_Nonnull)roomId attributes:(NSArray <__kindof NSString*> * _Nonnull)keyValues completionBlock:(void (^_Nullable)(EMError *_Nullable aError,NSDictionary<NSString*,EMError*> *_Nullable failureKeys))completionBlock;
1917
1944- (void)removeChatroomAttributeForced:(NSString *_Nonnull)roomId key:(NSString * _Nonnull)key completionBlock:(void (^_Nullable)(EMError *_Nullable aError))completionBlock;
1963- (void)fetchChatroomAttributes:(NSString *_Nonnull)roomId keys:(NSArray <__kindof NSString *> * _Nullable)keys completion:(void (^_Nullable)(EMError *_Nullable aError,NSDictionary<NSString*,NSString*> *_Nullable properties ))completionBlock;
1980- (void)fetchChatroomAllAttributes:(NSString * _Nonnull)roomId completion:(void (^ _Nullable)(EMError * _Nullable error,NSDictionary<NSString*,NSString*> * _Nullable properties))completionBlock;
1981
1982#pragma mark - EM_DEPRECATED_IOS 3.3.0
1983
2011- (EMChatroom *)fetchChatroomInfo:(NSString *)aChatroomId
2012 includeMembersList:(BOOL)aIncludeMembersList
2013 error:(EMError **)pError EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -IEMChatroomManager getChatroomSpecificationFromServerWithId:error: instead");
2014
2035- (void)getChatroomSpecificationFromServerByID:(NSString *)aChatroomId
2036 includeMembersList:(BOOL)aIncludeMembersList
2037 completion:(void (^)(EMChatroom *aChatroom, EMError *aError))aCompletionBlock EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -IEMChatroomManager getChatroomSpecificationFromServerWithId:completion: instead");
2038
2039#pragma mark - EM_DEPRECATED_IOS 3.2.3
2040
2056- (void)addDelegate:(id<EMChatroomManagerDelegate>)aDelegate EM_DEPRECATED_IOS(3_1_0, 3_2_2, "Use -IEMChatroomManager addDelegate:delegateQueue: instead");
2057
2058#pragma mark - EM_DEPRECATED_IOS < 3.2.3
2059
2083- (NSArray *)getAllChatroomsFromServerWithError:(EMError **)pError __deprecated_msg("Use -getChatroomsFromServerWithPage instead");
2084
2101- (void)getAllChatroomsFromServerWithCompletion:(void (^)(NSArray *aList, EMError *aError))aCompletionBlock __deprecated_msg("Use -getChatroomsFromServerWithPage instead");
2102
2121- (void)asyncGetAllChatroomsFromServer:(void (^)(NSArray *aList))aSuccessBlock
2122 failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -getAllChatroomsFromServerWithCompletion: instead");
2123
2145- (void)asyncJoinChatroom:(NSString *)aChatroomId
2146 success:(void (^)(EMChatroom *aRoom))aSuccessBlock
2147 failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -joinChatroom:completion: instead");
2148
2172- (void)asyncLeaveChatroom:(NSString *)aChatroomId
2173 success:(void (^)(EMChatroom *aRoom))aSuccessBlock
2174 failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -leaveChatroom:completion: instead");
2175
2198- (void)asyncFetchChatroomInfo:(NSString *)aChatroomId
2199 includeMembersList:(BOOL)aIncludeMembersList
2200 success:(void (^)(EMChatroom *aChatroom))aSuccessBlock
2201 failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -getChatroomSpecificationFromServerByID:includeMembersList:completion: instead");
2202@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