AgoraChatSDK 1.3.1
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
171- (void)joinChatroom:(NSString *_Nonnull)aChatroomId
172 ext:(NSString* _Nullable)ext
173 leaveOtherRooms:(BOOL)leaveOtherRooms
174 completion:(void (^_Nullable)(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
175
186- (void)leaveChatroom:(NSString *_Nonnull)aChatroomId
187 error:(AgoraChatError **_Nullable)pError;
188
199- (void)leaveChatroom:(NSString *_Nonnull)aChatroomId
200 completion:(void (^_Nullable)(AgoraChatError *_Nullable aError))aCompletionBlock;
201
215- (AgoraChatError *_Nullable)destroyChatroom:(NSString *_Nonnull)aChatroomId;
216
229- (void)destroyChatroom:(NSString *_Nonnull)aChatroomId
230 completion:(void (^_Nullable)(AgoraChatError * _Nullable aError))aCompletionBlock;
231
232#pragma mark - Fetch
233
245- (AgoraChatroom *_Nullable)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
246 error:(AgoraChatError *_Nullable*)pError;
247
258- (void)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
259 completion:(void (^_Nullable)(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
260
272- (void)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
273 fetchMembers:(bool)aFetchMembers
274 completion:(void (^_Nullable)(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
275
290- (AgoraChatCursorResult<NSString*> *_Nullable)getChatroomMemberListFromServerWithId:(NSString *_Nonnull)aChatroomId
291 cursor:(NSString *_Nullable)aCursor
292 pageSize:(NSInteger)aPageSize
293 error:(AgoraChatError **_Nullable)pError;
294
307- (void)getChatroomMemberListFromServerWithId:(NSString *_Nonnull)aChatroomId
308 cursor:(NSString *_Nullable)aCursor
309 pageSize:(NSInteger)aPageSize
310 completion:(void (^_Nullable)(AgoraChatCursorResult<NSString*> *_Nullable aResult, AgoraChatError *_Nullable aError))aCompletionBlock;
311
326- (NSArray<NSString *> *_Nullable)getChatroomBlacklistFromServerWithId:(NSString *_Nonnull)aChatroomId
327 pageNumber:(NSInteger)aPageNum
328 pageSize:(NSInteger)aPageSize
329 error:(AgoraChatError **_Nullable)pError;
330
345- (void)getChatroomBlacklistFromServerWithId:(NSString *_Nonnull)aChatroomId
346 pageNumber:(NSInteger)aPageNum
347 pageSize:(NSInteger)aPageSize
348 completion:(void (^_Nullable)(NSArray<NSString *> *_Nullable aList, AgoraChatError *_Nullable aError))aCompletionBlock;
349
364- (NSArray<NSString *> *_Nullable)getChatroomMuteListFromServerWithId:(NSString *_Nonnull)aChatroomId
365 pageNumber:(NSInteger)aPageNum
366 pageSize:(NSInteger)aPageSize
367 error:(AgoraChatError **_Nullable)pError;
368
383- (void)getChatroomMuteListFromServerWithId:(NSString *_Nonnull)aChatroomId
384 pageNumber:(NSInteger)aPageNum
385 pageSize:(NSInteger)aPageSize
386 completion:(void (^_Nullable)(NSArray<NSString *> *_Nullable aList, AgoraChatError *_Nullable aError))aCompletionBlock;
387
388
401- (NSArray<NSString *> *_Nullable)getChatroomWhiteListFromServerWithId:(NSString *_Nonnull)aChatroomId
402 error:(AgoraChatError **_Nullable)pError;
403
404
417- (void)getChatroomWhiteListFromServerWithId:(NSString *_Nonnull)aChatroomId
418 completion:(void (^_Nullable)(NSArray<NSString *> *_Nullable aList, AgoraChatError *_Nullable aError))aCompletionBlock;
419
430- (BOOL)isMemberInWhiteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
431 error:(AgoraChatError **_Nullable )pError;
432
443- (void)isMemberInWhiteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
444 completion:(void (^_Nullable)(BOOL inWhiteList, AgoraChatError *_Nullable aError))aCompletionBlock;
445
456- (void)isMemberInMuteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
457 completion:(void (^_Nullable)(BOOL inMuteList, AgoraChatError *_Nullable aError))aCompletionBlock;
469- (NSString *_Nullable)getChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
470 error:(AgoraChatError **_Nullable )pError;
471
482- (void)getChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
483 completion:(void (^_Nullable)(NSString *_Nullable aAnnouncement, AgoraChatError *_Nullable aError))aCompletionBlock;
484
485#pragma mark - Edit
486
501- (AgoraChatroom *)updateSubject:(NSString *_Nullable )aSubject
502 forChatroom:(NSString *_Nonnull)aChatroomId
503 error:(AgoraChatError **_Nullable )pError;
504
518- (void)updateSubject:(NSString *_Nullable )aSubject
519 forChatroom:(NSString *_Nonnull)aChatroomId
520 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
521
536- (AgoraChatroom *_Nullable )updateDescription:(NSString *_Nullable )aDescription
537 forChatroom:(NSString *_Nonnull)aChatroomId
538 error:(AgoraChatError **_Nullable )pError;
539
553- (void)updateDescription:(NSString *_Nullable )aDescription
554 forChatroom:(NSString *_Nonnull)aChatroomId
555 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
556
571- (AgoraChatroom *_Nullable )removeMembers:(NSArray<NSString *> *_Nonnull)aMembers
572 fromChatroom:(NSString *_Nonnull)aChatroomId
573 error:(AgoraChatError **_Nullable )pError;
574
588- (void)removeMembers:(NSArray<NSString *> *_Nonnull)aMembers
589 fromChatroom:(NSString *_Nonnull)aChatroomId
590 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
591
606- (AgoraChatroom *_Nullable )blockMembers:(NSArray<NSString *> *_Nonnull)aMembers
607 fromChatroom:(NSString *_Nonnull)aChatroomId
608 error:(AgoraChatError **_Nullable )pError;
609
623- (void)blockMembers:(NSArray<NSString *> *_Nonnull)aMembers
624 fromChatroom:(NSString *_Nonnull)aChatroomId
625 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
626
627
642- (AgoraChatroom *_Nullable )unblockMembers:(NSArray<NSString *> *_Nonnull)aMembers
643 fromChatroom:(NSString *_Nonnull)aChatroomId
644 error:(AgoraChatError **_Nullable )pError;
645
659- (void)unblockMembers:(NSArray<NSString *> *_Nonnull)aMembers
660 fromChatroom:(NSString *_Nonnull)aChatroomId
661 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
662
677- (AgoraChatroom *_Nullable )updateChatroomOwner:(NSString *_Nonnull)aChatroomId
678 newOwner:(NSString *_Nonnull)aNewOwner
679 error:(AgoraChatError **_Nullable )pError;
680
694- (void)updateChatroomOwner:(NSString *_Nonnull)aChatroomId
695 newOwner:(NSString *_Nonnull)aNewOwner
696 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
697
712- (AgoraChatroom *_Nullable )addAdmin:(NSString *_Nonnull)aAdmin
713 toChatroom:(NSString *_Nonnull)aChatroomId
714 error:(AgoraChatError **_Nullable )pError;
715
729- (void)addAdmin:(NSString *_Nonnull)aAdmin
730 toChatroom:(NSString *_Nonnull)aChatroomId
731 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroomp, AgoraChatError *_Nullable aError))aCompletionBlock;
732
747- (AgoraChatroom *_Nullable )removeAdmin:(NSString *_Nonnull)aAdmin
748 fromChatroom:(NSString *_Nonnull)aChatroomId
749 error:(AgoraChatError **_Nullable )pError;
750
764- (void)removeAdmin:(NSString *_Nonnull)aAdmin
765 fromChatroom:(NSString *_Nonnull)aChatroomId
766 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
767
768
784- (AgoraChatroom *_Nullable )muteMembers:(NSArray<NSString *> *_Nonnull)aMuteMembers
785 muteMilliseconds:(NSInteger)aMuteMilliseconds
786 fromChatroom:(NSString *_Nonnull)aChatroomId
787 error:(AgoraChatError **_Nullable )pError;
788
803- (void)muteMembers:(NSArray<NSString *> *_Nonnull)aMuteMembers
804 muteMilliseconds:(NSInteger)aMuteMilliseconds
805 fromChatroom:(NSString *_Nonnull)aChatroomId
806 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
807
822- (AgoraChatroom *_Nullable )unmuteMembers:(NSArray<NSString *> *_Nonnull)aMembers
823 fromChatroom:(NSString *_Nonnull)aChatroomId
824 error:(AgoraChatError **_Nullable )pError;
825
839- (void)unmuteMembers:(NSArray<NSString *> *_Nonnull)aMembers
840 fromChatroom:(NSString *_Nonnull)aChatroomId
841 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
842
843
844
858- (AgoraChatroom *_Nullable )muteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
859 error:(AgoraChatError **_Nullable )pError;
860
873- (void)muteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
874 completion:(void(^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
875
876
890- (AgoraChatroom *_Nullable )unmuteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
891 error:(AgoraChatError **_Nullable )pError;
892
893
906- (void)unmuteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
907 completion:(void(^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
908
909
924- (AgoraChatroom *_Nullable )addWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
925 fromChatroom:(NSString *_Nonnull)aChatroomId
926 error:(AgoraChatError **_Nullable )pError;
927
941- (void)addWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
942 fromChatroom:(NSString *_Nonnull)aChatroomId
943 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
944
959- (AgoraChatroom *_Nullable )removeWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
960 fromChatroom:(NSString *_Nonnull)aChatroomId
961 error:(AgoraChatError **_Nullable )pError;
962
976- (void)removeWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
977 fromChatroom:(NSString *_Nonnull)aChatroomId
978 completion:(void (^_Nullable )(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
979
994- (AgoraChatroom *_Nullable )updateChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
995 announcement:(NSString *_Nullable )aAnnouncement
996 error:(AgoraChatError **_Nullable )pError;
997
1011- (void)updateChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
1012 announcement:(NSString *_Nullable)aAnnouncement
1013 completion:(void (^_Nullable)(AgoraChatroom *_Nullable aChatroom, AgoraChatError *_Nullable aError))aCompletionBlock;
1031- (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 ;
1055- (void)setChatroomAttribute:(NSString *_Nonnull)roomId key:(NSString *_Nonnull)key value:(NSString *_Nonnull)value autoDelete:(BOOL)autoDelete completionBlock:(void (^_Nullable)(AgoraChatError *_Nullable aError))completionBlock;
1070- (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;
1071
1095- (void)setChatroomAttributeForced:(NSString *_Nonnull)roomId key:(NSString *_Nonnull)key value:(NSString *_Nonnull)value autoDelete:(BOOL)autoDelete completionBlock:(void (^_Nullable)(AgoraChatError *_Nullable aError))completionBlock;
1096
1111- (void)removeChatroomAttributes:(NSString *_Nonnull)roomId attributes:(NSArray <__kindof NSString*> * _Nonnull)keyValues completionBlock:(void (^_Nullable)(AgoraChatError *_Nullable aError,NSDictionary<NSString*,AgoraChatError*> *_Nullable failureKeys))completionBlock;
1126- (void)removeChatroomAttribute:(NSString *_Nonnull)roomId key:(NSString * _Nonnull)key completionBlock:(void (^_Nullable)(AgoraChatError *_Nullable aError))completionBlock;
1141- (void)removeChatroomAttributesForced:(NSString *_Nonnull)roomId attributes:(NSArray <__kindof NSString*> * _Nonnull)keyValues completionBlock:(void (^_Nullable)(AgoraChatError *_Nullable aError,NSDictionary<NSString*,AgoraChatError*> *_Nullable failureKeys))completionBlock;
1142
1157- (void)removeChatroomAttributeForced:(NSString *_Nonnull)roomId key:(NSString * _Nonnull)key completionBlock:(void (^_Nullable)(AgoraChatError *_Nullable aError))completionBlock;
1168- (void)fetchChatroomAttributes:(NSString *_Nonnull)roomId keys:(NSArray <__kindof NSString *> * _Nullable)keys completion:(void (^_Nullable)(AgoraChatError *_Nullable aError,NSDictionary<NSString*,NSString*> *_Nullable properties ))completionBlock;
1178- (void)fetchChatroomAllAttributes:(NSString * _Nonnull)roomId completion:(void (^ _Nullable)(AgoraChatError * _Nullable error,NSDictionary<NSString*,NSString*> * _Nullable properties))completionBlock;
1179
1180#pragma mark - EM_DEPRECATED_IOS 3.3.0
1181
1196- (AgoraChatroom *)fetchChatroomInfo:(NSString *)aChatroomId
1197 includeMembersList:(BOOL)aIncludeMembersList
1198 error:(AgoraChatError **)pError EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -IAgoraChatroomManager getChatroomSpecificationFromServerWithId:error: instead");
1199
1211- (void)getChatroomSpecificationFromServerByID:(NSString *)aChatroomId
1212 includeMembersList:(BOOL)aIncludeMembersList
1213 completion:(void (^)(AgoraChatroom *aChatroom, AgoraChatError *aError))aCompletionBlock EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -IAgoraChatroomManager getChatroomSpecificationFromServerWithId:completion: instead");
1214
1215#pragma mark - EM_DEPRECATED_IOS 3.2.3
1216
1225- (void)addDelegate:(id<AgoraChatroomManagerDelegate>)aDelegate EM_DEPRECATED_IOS(3_1_0, 3_2_2, "Use -IAgoraChatroomManager addDelegate:delegateQueue: instead");
1226
1227#pragma mark - EM_DEPRECATED_IOS < 3.2.3
1228
1241- (NSArray *)getAllChatroomsFromServerWithError:(AgoraChatError **)pError __deprecated_msg("Use -getChatroomsFromServerWithPage instead");
1242
1252- (void)getAllChatroomsFromServerWithCompletion:(void (^)(NSArray *aList, AgoraChatError *aError))aCompletionBlock __deprecated_msg("Use -getChatroomsFromServerWithPage instead");
1253
1264- (void)asyncGetAllChatroomsFromServer:(void (^)(NSArray *aList))aSuccessBlock
1265 failure:(void (^)(AgoraChatError *aError))aFailureBlock __deprecated_msg("Use -getAllChatroomsFromServerWithCompletion: instead");
1266
1278- (void)asyncJoinChatroom:(NSString *)aChatroomId
1279 success:(void (^)(AgoraChatroom *aRoom))aSuccessBlock
1280 failure:(void (^)(AgoraChatError *aError))aFailureBlock __deprecated_msg("Use -joinChatroom:completion: instead");
1281
1294- (void)asyncLeaveChatroom:(NSString *)aChatroomId
1295 success:(void (^)(AgoraChatroom *aRoom))aSuccessBlock
1296 failure:(void (^)(AgoraChatError *aError))aFailureBlock __deprecated_msg("Use -leaveChatroom:completion: instead");
1297
1310- (void)asyncFetchChatroomInfo:(NSString *)aChatroomId
1311 includeMembersList:(BOOL)aIncludeMembersList
1312 success:(void (^)(AgoraChatroom *aChatroom))aSuccessBlock
1313 failure:(void (^)(AgoraChatError *aError))aFailureBlock __deprecated_msg("Use -getChatroomSpecificationFromServerByID:includeMembersList:completion: instead");
1314@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