AgoraChatSDK 1.2.0
IAgoraChatroomManager.h
9#import <Foundation/Foundation.h>
10
11#import "AgoraChatCommonDefs.h"
12#import "AgoraChatroomManagerDelegate.h"
13#import "AgoraChatroomOptions.h"
14#import "AgoraChatroom.h"
15#import "AgoraChatPageResult.h"
16
17#import "AgoraChatCursorResult.h"
18
19@class AgoraChatError;
20
25@protocol IAgoraChatroomManager <NSObject>
26
27@required
28
29#pragma mark - Delegate
30
38- (void)addDelegate:(id<AgoraChatroomManagerDelegate> _Nonnull)aDelegate
39 delegateQueue:(dispatch_queue_t _Nullable)aQueue;
40
47- (void)removeDelegate:(id<AgoraChatroomManagerDelegate> _Nonnull)aDelegate;
48
49#pragma mark - Fetch Chatrooms
50
63- (AgoraChatPageResult<AgoraChatroom*> *_Nullable)getChatroomsFromServerWithPage:(NSInteger)aPageNum
64 pageSize:(NSInteger)aPageSize
65 error:(AgoraChatError **_Nullable)pError;
66
79- (void)getChatroomsFromServerWithPage:(NSInteger)aPageNum
80 pageSize:(NSInteger)aPageSize
81 completion:(void (^_Nullable)(AgoraChatPageResult<AgoraChatroom*> *_Nullable aResult, AgoraChatError *_Nullable aError))aCompletionBlock;
82
83#pragma mark - Create
84
100- (AgoraChatroom *_Nullable)createChatroomWithSubject:(NSString *_Nullable)aSubject
101 description:(NSString *_Nullable)aDescription
102 invitees:(NSArray<NSString *> *_Nullable)aInvitees
103 message:(NSString *_Nullable)aMessage
104 maxMembersCount:(NSInteger)aMaxMembersCount
105 error:(AgoraChatError **_Nullable)pError;
106
121- (void)createChatroomWithSubject:(NSString *_Nullable)aSubject
122 description:(NSString *_Nullable)aDescription
123 invitees:(NSArray<NSString *> *_Nullable)aInvitees
124 message:(NSString *_Nullable)aMessage
125 maxMembersCount:(NSInteger)aMaxMembersCount
126 completion:(void (^_Nullable)(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
127
128#pragma mark - Edit Chatroom
129
141- (AgoraChatroom *)joinChatroom:(NSString * _Nonnull)aChatroomId
142 error:(AgoraChatError ** _Nullable)pError;
143
154- (void)joinChatroom:(NSString *_Nonnull)aChatroomId
155 completion:(void (^_Nullable)(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
156
167- (void)leaveChatroom:(NSString *_Nonnull)aChatroomId
168 error:(AgoraChatError **_Nullable)pError;
169
180- (void)leaveChatroom:(NSString *_Nonnull)aChatroomId
181 completion:(void (^_Nullable)(AgoraChatError *_Nullable aError))aCompletionBlock;
182
196- (AgoraChatError *_Nullable)destroyChatroom:(NSString *_Nonnull)aChatroomId;
197
210- (void)destroyChatroom:(NSString *_Nonnull)aChatroomId
211 completion:(void (^_Nullable)(AgoraChatError * _Nullable aError))aCompletionBlock;
212
213#pragma mark - Fetch
214
226- (AgoraChatroom *_Nullable)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
227 error:(AgoraChatError *_Nullable*)pError;
228
239- (void)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
240 completion:(void (^_Nullable)(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
241
253- (void)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
254 fetchMembers:(bool)aFetchMembers
255 completion:(void (^_Nullable)(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
256
271- (AgoraChatCursorResult<NSString*> *_Nullable)getChatroomMemberListFromServerWithId:(NSString *_Nonnull)aChatroomId
272 cursor:(NSString *_Nullable)aCursor
273 pageSize:(NSInteger)aPageSize
274 error:(AgoraChatError **_Nullable)pError;
275
288- (void)getChatroomMemberListFromServerWithId:(NSString *_Nonnull)aChatroomId
289 cursor:(NSString *_Nullable)aCursor
290 pageSize:(NSInteger)aPageSize
291 completion:(void (^_Nullable)(AgoraChatCursorResult<NSString*> *_Nullable aResult, AgoraChatError *_Nullable aError))aCompletionBlock;
292
307- (NSArray<NSString *> *_Nullable)getChatroomBlacklistFromServerWithId:(NSString *_Nonnull)aChatroomId
308 pageNumber:(NSInteger)aPageNum
309 pageSize:(NSInteger)aPageSize
310 error:(AgoraChatError **_Nullable)pError;
311
326- (void)getChatroomBlacklistFromServerWithId:(NSString *_Nonnull)aChatroomId
327 pageNumber:(NSInteger)aPageNum
328 pageSize:(NSInteger)aPageSize
329 completion:(void (^_Nullable)(NSArray<NSString *> *_Nullable aList, AgoraChatError *_Nullable aError))aCompletionBlock;
330
345- (NSArray<NSString *> *_Nullable)getChatroomMuteListFromServerWithId:(NSString *_Nonnull)aChatroomId
346 pageNumber:(NSInteger)aPageNum
347 pageSize:(NSInteger)aPageSize
348 error:(AgoraChatError **_Nullable)pError;
349
364- (void)getChatroomMuteListFromServerWithId:(NSString *_Nonnull)aChatroomId
365 pageNumber:(NSInteger)aPageNum
366 pageSize:(NSInteger)aPageSize
367 completion:(void (^_Nullable)(NSArray<NSString *> *_Nullable aList, AgoraChatError *_Nullable aError))aCompletionBlock;
368
369
382- (NSArray<NSString *> *_Nullable)getChatroomWhiteListFromServerWithId:(NSString *_Nonnull)aChatroomId
383 error:(AgoraChatError **_Nullable)pError;
384
385
398- (void)getChatroomWhiteListFromServerWithId:(NSString *_Nonnull)aChatroomId
399 completion:(void (^_Nullable)(NSArray<NSString *> *_Nullable aList, AgoraChatError *_Nullable aError))aCompletionBlock;
400
411- (BOOL)isMemberInWhiteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
412 error:(AgoraChatError **_Nullable )pError;
413
424- (void)isMemberInWhiteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
425 completion:(void (^_Nullable)(BOOL inWhiteList, AgoraChatError *_Nullable aError))aCompletionBlock;
426
437- (void)isMemberInMuteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
438 completion:(void (^_Nullable)(BOOL inMuteList, AgoraChatError *_Nullable aError))aCompletionBlock;
450- (NSString *_Nullable)getChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
451 error:(AgoraChatError **_Nullable )pError;
452
463- (void)getChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
464 completion:(void (^_Nullable)(NSString *_Nullable aAnnouncement, AgoraChatError *_Nullable aError))aCompletionBlock;
465
466#pragma mark - Edit
467
482- (AgoraChatroom *)updateSubject:(NSString *_Nullable )aSubject
483 forChatroom:(NSString *_Nonnull)aChatroomId
484 error:(AgoraChatError **_Nullable )pError;
485
499- (void)updateSubject:(NSString *_Nullable )aSubject
500 forChatroom:(NSString *_Nonnull)aChatroomId
501 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
502
517- (AgoraChatroom *_Nullable )updateDescription:(NSString *_Nullable )aDescription
518 forChatroom:(NSString *_Nonnull)aChatroomId
519 error:(AgoraChatError **_Nullable )pError;
520
534- (void)updateDescription:(NSString *_Nullable )aDescription
535 forChatroom:(NSString *_Nonnull)aChatroomId
536 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
537
552- (AgoraChatroom *_Nullable )removeMembers:(NSArray<NSString *> *_Nonnull)aMembers
553 fromChatroom:(NSString *_Nonnull)aChatroomId
554 error:(AgoraChatError **_Nullable )pError;
555
569- (void)removeMembers:(NSArray<NSString *> *_Nonnull)aMembers
570 fromChatroom:(NSString *_Nonnull)aChatroomId
571 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
572
587- (AgoraChatroom *_Nullable )blockMembers:(NSArray<NSString *> *_Nonnull)aMembers
588 fromChatroom:(NSString *_Nonnull)aChatroomId
589 error:(AgoraChatError **_Nullable )pError;
590
604- (void)blockMembers:(NSArray<NSString *> *_Nonnull)aMembers
605 fromChatroom:(NSString *_Nonnull)aChatroomId
606 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
607
608
623- (AgoraChatroom *_Nullable )unblockMembers:(NSArray<NSString *> *_Nonnull)aMembers
624 fromChatroom:(NSString *_Nonnull)aChatroomId
625 error:(AgoraChatError **_Nullable )pError;
626
640- (void)unblockMembers:(NSArray<NSString *> *_Nonnull)aMembers
641 fromChatroom:(NSString *_Nonnull)aChatroomId
642 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
643
658- (AgoraChatroom *_Nullable )updateChatroomOwner:(NSString *_Nonnull)aChatroomId
659 newOwner:(NSString *_Nonnull)aNewOwner
660 error:(AgoraChatError **_Nullable )pError;
661
675- (void)updateChatroomOwner:(NSString *_Nonnull)aChatroomId
676 newOwner:(NSString *_Nonnull)aNewOwner
677 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
678
693- (AgoraChatroom *_Nullable )addAdmin:(NSString *_Nonnull)aAdmin
694 toChatroom:(NSString *_Nonnull)aChatroomId
695 error:(AgoraChatError **_Nullable )pError;
696
710- (void)addAdmin:(NSString *_Nonnull)aAdmin
711 toChatroom:(NSString *_Nonnull)aChatroomId
712 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroomp, AgoraChatError *_Nullable aError))aCompletionBlock;
713
728- (AgoraChatroom *_Nullable )removeAdmin:(NSString *_Nonnull)aAdmin
729 fromChatroom:(NSString *_Nonnull)aChatroomId
730 error:(AgoraChatError **_Nullable )pError;
731
745- (void)removeAdmin:(NSString *_Nonnull)aAdmin
746 fromChatroom:(NSString *_Nonnull)aChatroomId
747 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
748
749
765- (AgoraChatroom *_Nullable )muteMembers:(NSArray<NSString *> *_Nonnull)aMuteMembers
766 muteMilliseconds:(NSInteger)aMuteMilliseconds
767 fromChatroom:(NSString *_Nonnull)aChatroomId
768 error:(AgoraChatError **_Nullable )pError;
769
784- (void)muteMembers:(NSArray<NSString *> *_Nonnull)aMuteMembers
785 muteMilliseconds:(NSInteger)aMuteMilliseconds
786 fromChatroom:(NSString *_Nonnull)aChatroomId
787 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
788
803- (AgoraChatroom *_Nullable )unmuteMembers:(NSArray<NSString *> *_Nonnull)aMembers
804 fromChatroom:(NSString *_Nonnull)aChatroomId
805 error:(AgoraChatError **_Nullable )pError;
806
820- (void)unmuteMembers:(NSArray<NSString *> *_Nonnull)aMembers
821 fromChatroom:(NSString *_Nonnull)aChatroomId
822 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
823
824
825
839- (AgoraChatroom *_Nullable )muteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
840 error:(AgoraChatError **_Nullable )pError;
841
854- (void)muteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
855 completion:(void(^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
856
857
871- (AgoraChatroom *_Nullable )unmuteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
872 error:(AgoraChatError **_Nullable )pError;
873
874
887- (void)unmuteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
888 completion:(void(^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
889
890
905- (AgoraChatroom *_Nullable )addWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
906 fromChatroom:(NSString *_Nonnull)aChatroomId
907 error:(AgoraChatError **_Nullable )pError;
908
922- (void)addWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
923 fromChatroom:(NSString *_Nonnull)aChatroomId
924 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
925
940- (AgoraChatroom *_Nullable )removeWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
941 fromChatroom:(NSString *_Nonnull)aChatroomId
942 error:(AgoraChatError **_Nullable )pError;
943
957- (void)removeWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
958 fromChatroom:(NSString *_Nonnull)aChatroomId
959 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
960
975- (AgoraChatroom *_Nullable )updateChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
976 announcement:(NSString *_Nullable )aAnnouncement
977 error:(AgoraChatError **_Nullable )pError;
978
992- (void)updateChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
993 announcement:(NSString *_Nullable)aAnnouncement
994 completion:(void (^_Nullable)(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
1012- (void)setChatroomAttributes:(NSString *_Nonnull)roomId attributes:(NSDictionary<NSString*,NSString*> *_Nonnull)keyValues autoDelete:(BOOL)autoDelete completionBlock:(void (^_Nullable)(AgoraChatError *_Nullable aError,NSDictionary<NSString*,AgoraChatError*> *_Nullable failureKeys))completionBlock ;
1036- (void)setChatroomAttribute:(NSString *_Nonnull)roomId key:(NSString *_Nonnull)key value:(NSString *_Nonnull)value autoDelete:(BOOL)autoDelete completionBlock:(void (^_Nullable)(AgoraChatError *_Nullable aError))completionBlock;
1051- (void)setChatroomAttributesForced:(NSString *_Nonnull)roomId attributes:(NSDictionary<NSString*,NSString*> *_Nonnull)keyValues autoDelete:(BOOL)autoDelete completionBlock:(void (^_Nullable)(AgoraChatError *_Nullable aError,NSDictionary<NSString*,AgoraChatError*> *_Nullable failureKeys))completionBlock;
1052
1076- (void)setChatroomAttributeForced:(NSString *_Nonnull)roomId key:(NSString *_Nonnull)key value:(NSString *_Nonnull)value autoDelete:(BOOL)autoDelete completionBlock:(void (^_Nullable)(AgoraChatError *_Nullable aError))completionBlock;
1077
1092- (void)removeChatroomAttributes:(NSString *_Nonnull)roomId attributes:(NSArray <__kindof NSString*> * _Nonnull)keyValues completionBlock:(void (^_Nullable)(AgoraChatError *_Nullable aError,NSDictionary<NSString*,AgoraChatError*> *_Nullable failureKeys))completionBlock;
1107- (void)removeChatroomAttribute:(NSString *_Nonnull)roomId key:(NSString * _Nonnull)key completionBlock:(void (^_Nullable)(AgoraChatError *_Nullable aError))completionBlock;
1122- (void)removeChatroomAttributesForced:(NSString *_Nonnull)roomId attributes:(NSArray <__kindof NSString*> * _Nonnull)keyValues completionBlock:(void (^_Nullable)(AgoraChatError *_Nullable aError,NSDictionary<NSString*,AgoraChatError*> *_Nullable failureKeys))completionBlock;
1123
1138- (void)removeChatroomAttributeForced:(NSString *_Nonnull)roomId key:(NSString * _Nonnull)key completionBlock:(void (^_Nullable)(AgoraChatError *_Nullable aError))completionBlock;
1149- (void)fetchChatroomAttributes:(NSString *_Nonnull)roomId keys:(NSArray <__kindof NSString *> * _Nullable)keys completion:(void (^_Nullable)(AgoraChatError *_Nullable aError,NSDictionary<NSString*,NSString*> *_Nullable properties ))completionBlock;
1159- (void)fetchChatroomAllAttributes:(NSString * _Nonnull)roomId completion:(void (^ _Nullable)(AgoraChatError * _Nullable error,NSDictionary<NSString*,NSString*> * _Nullable properties))completionBlock;
1160
1161#pragma mark - EM_DEPRECATED_IOS 3.3.0
1162
1177- (AgoraChatroom *)fetchChatroomInfo:(NSString *)aChatroomId
1178 includeMembersList:(BOOL)aIncludeMembersList
1179 error:(AgoraChatError **)pError EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -IAgoraChatroomManager getChatroomSpecificationFromServerWithId:error: instead");
1180
1192- (void)getChatroomSpecificationFromServerByID:(NSString *)aChatroomId
1193 includeMembersList:(BOOL)aIncludeMembersList
1194 completion:(void (^)(AgoraChatroom *aChatroom, AgoraChatError *aError))aCompletionBlock EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -IAgoraChatroomManager getChatroomSpecificationFromServerWithId:completion: instead");
1195
1196#pragma mark - EM_DEPRECATED_IOS 3.2.3
1197
1206- (void)addDelegate:(id<AgoraChatroomManagerDelegate>)aDelegate EM_DEPRECATED_IOS(3_1_0, 3_2_2, "Use -IAgoraChatroomManager addDelegate:delegateQueue: instead");
1207
1208#pragma mark - EM_DEPRECATED_IOS < 3.2.3
1209
1222- (NSArray *)getAllChatroomsFromServerWithError:(AgoraChatError **)pError __deprecated_msg("Use -getChatroomsFromServerWithPage instead");
1223
1233- (void)getAllChatroomsFromServerWithCompletion:(void (^)(NSArray *aList, AgoraChatError *aError))aCompletionBlock __deprecated_msg("Use -getChatroomsFromServerWithPage instead");
1234
1245- (void)asyncGetAllChatroomsFromServer:(void (^)(NSArray *aList))aSuccessBlock
1246 failure:(void (^)(AgoraChatError *aError))aFailureBlock __deprecated_msg("Use -getAllChatroomsFromServerWithCompletion: instead");
1247
1259- (void)asyncJoinChatroom:(NSString *)aChatroomId
1260 success:(void (^)(AgoraChatroom *aRoom))aSuccessBlock
1261 failure:(void (^)(AgoraChatError *aError))aFailureBlock __deprecated_msg("Use -joinChatroom:completion: instead");
1262
1275- (void)asyncLeaveChatroom:(NSString *)aChatroomId
1276 success:(void (^)(AgoraChatroom *aRoom))aSuccessBlock
1277 failure:(void (^)(AgoraChatError *aError))aFailureBlock __deprecated_msg("Use -leaveChatroom:completion: instead");
1278
1291- (void)asyncFetchChatroomInfo:(NSString *)aChatroomId
1292 includeMembersList:(BOOL)aIncludeMembersList
1293 success:(void (^)(AgoraChatroom *aChatroom))aSuccessBlock
1294 failure:(void (^)(AgoraChatError *aError))aFailureBlock __deprecated_msg("Use -getChatroomSpecificationFromServerByID:includeMembersList:completion: instead");
1295@end
Definition: AgoraChatCursorResult.h:16
Definition: AgoraChatError.h:18
Definition: AgoraChatPageResult.h:15
Definition: AgoraChatroom.h:30
Definition: AgoraChatroomManagerDelegate.h:29
Definition: IAgoraChatroomManager.h:25