AgoraChatSDK 1.0.7
IAgoraChatroomManager.h
15#import <Foundation/Foundation.h>
16
17#import "AgoraChatCommonDefs.h"
18#import "AgoraChatroomManagerDelegate.h"
19#import "AgoraChatroomOptions.h"
20#import "AgoraChatroom.h"
21#import "AgoraChatPageResult.h"
22
23#import "AgoraChatCursorResult.h"
24
25@class AgoraChatError;
26
34@protocol IAgoraChatroomManager <NSObject>
35
36@required
37
38#pragma mark - Delegate
39
53- (void)addDelegate:(id<AgoraChatroomManagerDelegate> _Nonnull)aDelegate
54 delegateQueue:(dispatch_queue_t _Nullable)aQueue;
55
67- (void)removeDelegate:(id<AgoraChatroomManagerDelegate> _Nonnull)aDelegate;
68
69#pragma mark - Fetch Chatrooms
70
94- (AgoraChatPageResult<AgoraChatroom*> *_Nullable)getChatroomsFromServerWithPage:(NSInteger)aPageNum
95 pageSize:(NSInteger)aPageSize
96 error:(AgoraChatError **_Nullable)pError;
97
119- (void)getChatroomsFromServerWithPage:(NSInteger)aPageNum
120 pageSize:(NSInteger)aPageSize
121 completion:(void (^_Nullable)(AgoraChatPageResult<AgoraChatroom*> *_Nullable aResult, AgoraChatError *_Nullable aError))aCompletionBlock;
122
123#pragma mark - Create
124
154- (AgoraChatroom *_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:(AgoraChatError **_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)(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
194
195#pragma mark - Edit Chatroom
196
218- (AgoraChatroom *)joinChatroom:(NSString * _Nonnull)aChatroomId
219 error:(AgoraChatError ** _Nullable)pError;
220
240- (void)joinChatroom:(NSString *_Nonnull)aChatroomId
241 completion:(void (^_Nullable)(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
242
262- (void)leaveChatroom:(NSString *_Nonnull)aChatroomId
263 error:(AgoraChatError **_Nullable)pError;
264
284- (void)leaveChatroom:(NSString *_Nonnull)aChatroomId
285 completion:(void (^_Nullable)(AgoraChatError *_Nullable aError))aCompletionBlock;
286
312- (AgoraChatError *_Nullable)destroyChatroom:(NSString *_Nonnull)aChatroomId;
313
336- (void)destroyChatroom:(NSString *_Nonnull)aChatroomId
337 completion:(void (^_Nullable)(AgoraChatError * _Nullable aError))aCompletionBlock;
338
339#pragma mark - Fetch
340
362- (AgoraChatroom *_Nullable)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
363 error:(AgoraChatError *_Nullable*)pError;
364
383- (void)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
384 completion:(void (^_Nullable)(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
385
406- (void)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
407 fetchMembers:(bool)aFetchMembers
408 completion:(void (^_Nullable)(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
409
436- (AgoraChatCursorResult<NSString*> *_Nullable)getChatroomMemberListFromServerWithId:(NSString *_Nonnull)aChatroomId
437 cursor:(NSString *_Nullable)aCursor
438 pageSize:(NSInteger)aPageSize
439 error:(AgoraChatError **_Nullable)pError;
440
464- (void)getChatroomMemberListFromServerWithId:(NSString *_Nonnull)aChatroomId
465 cursor:(NSString *_Nullable)aCursor
466 pageSize:(NSInteger)aPageSize
467 completion:(void (^_Nullable)(AgoraChatCursorResult<NSString*> *_Nullable aResult, AgoraChatError *_Nullable aError))aCompletionBlock;
468
496- (NSArray<NSString *> *_Nullable)getChatroomBlacklistFromServerWithId:(NSString *_Nonnull)aChatroomId
497 pageNumber:(NSInteger)aPageNum
498 pageSize:(NSInteger)aPageSize
499 error:(AgoraChatError **_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, AgoraChatError *_Nullable aError))aCompletionBlock;
532
560- (NSArray<NSString *> *_Nullable)getChatroomMuteListFromServerWithId:(NSString *_Nonnull)aChatroomId
561 pageNumber:(NSInteger)aPageNum
562 pageSize:(NSInteger)aPageSize
563 error:(AgoraChatError **_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, AgoraChatError *_Nullable aError))aCompletionBlock;
596
597
621- (NSArray<NSString *> *_Nullable)getChatroomWhiteListFromServerWithId:(NSString *_Nonnull)aChatroomId
622 error:(AgoraChatError **_Nullable)pError;
623
624
648- (void)getChatroomWhiteListFromServerWithId:(NSString *_Nonnull)aChatroomId
649 completion:(void (^_Nullable)(NSArray<NSString *> *_Nullable aList, AgoraChatError *_Nullable aError))aCompletionBlock;
650
670- (BOOL)isMemberInWhiteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
671 error:(AgoraChatError **_Nullable )pError;
672
692- (void)isMemberInWhiteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
693 completion:(void (^_Nullable)(BOOL inWhiteList, AgoraChatError *_Nullable aError))aCompletionBlock;
715- (NSString *_Nullable)getChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
716 error:(AgoraChatError **_Nullable )pError;
717
736- (void)getChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
737 completion:(void (^_Nullable)(NSString *_Nullable aAnnouncement, AgoraChatError *_Nullable aError))aCompletionBlock;
738
739#pragma mark - Edit
740
768- (AgoraChatroom *)updateSubject:(NSString *_Nullable )aSubject
769 forChatroom:(NSString *_Nonnull)aChatroomId
770 error:(AgoraChatError **_Nullable )pError;
771
797- (void)updateSubject:(NSString *_Nullable )aSubject
798 forChatroom:(NSString *_Nonnull)aChatroomId
799 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
800
828- (AgoraChatroom *_Nullable )updateDescription:(NSString *_Nullable )aDescription
829 forChatroom:(NSString *_Nonnull)aChatroomId
830 error:(AgoraChatError **_Nullable )pError;
831
857- (void)updateDescription:(NSString *_Nullable )aDescription
858 forChatroom:(NSString *_Nonnull)aChatroomId
859 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
860
888- (AgoraChatroom *_Nullable )removeMembers:(NSArray<NSString *> *_Nonnull)aMembers
889 fromChatroom:(NSString *_Nonnull)aChatroomId
890 error:(AgoraChatError **_Nullable )pError;
891
917- (void)removeMembers:(NSArray<NSString *> *_Nonnull)aMembers
918 fromChatroom:(NSString *_Nonnull)aChatroomId
919 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
920
948- (AgoraChatroom *_Nullable )blockMembers:(NSArray<NSString *> *_Nonnull)aMembers
949 fromChatroom:(NSString *_Nonnull)aChatroomId
950 error:(AgoraChatError **_Nullable )pError;
951
977- (void)blockMembers:(NSArray<NSString *> *_Nonnull)aMembers
978 fromChatroom:(NSString *_Nonnull)aChatroomId
979 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
980
981
1009- (AgoraChatroom *_Nullable )unblockMembers:(NSArray<NSString *> *_Nonnull)aMembers
1010 fromChatroom:(NSString *_Nonnull)aChatroomId
1011 error:(AgoraChatError **_Nullable )pError;
1012
1038- (void)unblockMembers:(NSArray<NSString *> *_Nonnull)aMembers
1039 fromChatroom:(NSString *_Nonnull)aChatroomId
1040 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
1041
1069- (AgoraChatroom *_Nullable )updateChatroomOwner:(NSString *_Nonnull)aChatroomId
1070 newOwner:(NSString *_Nonnull)aNewOwner
1071 error:(AgoraChatError **_Nullable )pError;
1072
1098- (void)updateChatroomOwner:(NSString *_Nonnull)aChatroomId
1099 newOwner:(NSString *_Nonnull)aNewOwner
1100 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
1101
1129- (AgoraChatroom *_Nullable )addAdmin:(NSString *_Nonnull)aAdmin
1130 toChatroom:(NSString *_Nonnull)aChatroomId
1131 error:(AgoraChatError **_Nullable )pError;
1132
1158- (void)addAdmin:(NSString *_Nonnull)aAdmin
1159 toChatroom:(NSString *_Nonnull)aChatroomId
1160 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroomp, AgoraChatError *_Nullable aError))aCompletionBlock;
1161
1189- (AgoraChatroom *_Nullable )removeAdmin:(NSString *_Nonnull)aAdmin
1190 fromChatroom:(NSString *_Nonnull)aChatroomId
1191 error:(AgoraChatError **_Nullable )pError;
1192
1218- (void)removeAdmin:(NSString *_Nonnull)aAdmin
1219 fromChatroom:(NSString *_Nonnull)aChatroomId
1220 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
1221
1222
1252- (AgoraChatroom *_Nullable )muteMembers:(NSArray<NSString *> *_Nonnull)aMuteMembers
1253 muteMilliseconds:(NSInteger)aMuteMilliseconds
1254 fromChatroom:(NSString *_Nonnull)aChatroomId
1255 error:(AgoraChatError **_Nullable )pError;
1256
1283- (void)muteMembers:(NSArray<NSString *> *_Nonnull)aMuteMembers
1284 muteMilliseconds:(NSInteger)aMuteMilliseconds
1285 fromChatroom:(NSString *_Nonnull)aChatroomId
1286 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
1287
1315- (AgoraChatroom *_Nullable )unmuteMembers:(NSArray<NSString *> *_Nonnull)aMembers
1316 fromChatroom:(NSString *_Nonnull)aChatroomId
1317 error:(AgoraChatError **_Nullable )pError;
1318
1343- (void)unmuteMembers:(NSArray<NSString *> *_Nonnull)aMembers
1344 fromChatroom:(NSString *_Nonnull)aChatroomId
1345 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
1346
1347
1348
1374- (AgoraChatroom *_Nullable )muteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1375 error:(AgoraChatError **_Nullable )pError;
1376
1399- (void)muteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1400 completion:(void(^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
1401
1402
1428- (AgoraChatroom *_Nullable )unmuteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1429 error:(AgoraChatError **_Nullable )pError;
1430
1431
1454- (void)unmuteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1455 completion:(void(^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
1456
1457
1485- (AgoraChatroom *_Nullable )addWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1486 fromChatroom:(NSString *_Nonnull)aChatroomId
1487 error:(AgoraChatError **_Nullable )pError;
1488
1513- (void)addWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1514 fromChatroom:(NSString *_Nonnull)aChatroomId
1515 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
1516
1544- (AgoraChatroom *_Nullable )removeWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1545 fromChatroom:(NSString *_Nonnull)aChatroomId
1546 error:(AgoraChatError **_Nullable )pError;
1547
1572- (void)removeWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1573 fromChatroom:(NSString *_Nonnull)aChatroomId
1574 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
1575
1603- (AgoraChatroom *_Nullable )updateChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
1604 announcement:(NSString *_Nullable )aAnnouncement
1605 error:(AgoraChatError **_Nullable )pError;
1606
1631- (void)updateChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
1632 announcement:(NSString *_Nullable)aAnnouncement
1633 completion:(void (^_Nullable)(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
1634
1635@end
Definition: AgoraChatCursorResult.h:27
Definition: AgoraChatError.h:27
Definition: AgoraChatPageResult.h:24
Definition: AgoraChatroom.h:42
Definition: AgoraChatroomManagerDelegate.h:41
Definition: IAgoraChatroomManager.h:34