HyphenateChatSDK 4.12.0
IEMGroupManager.h
15#import <Foundation/Foundation.h>
16
17#import "EMCommonDefs.h"
18#import "EMGroupManagerDelegate.h"
19#import "EMGroup.h"
20#import "EMGroupOptions.h"
21#import "EMCursorResult.h"
22#import "EMGroupSharedFile.h"
23
31@protocol IEMGroupManager <NSObject>
32
33@required
34
35#pragma mark - Delegate
36
50- (void)addDelegate:(id<EMGroupManagerDelegate> _Nonnull)aDelegate
51 delegateQueue:(dispatch_queue_t _Nullable )aQueue;
52
64- (void)removeDelegate:(id _Nonnull)aDelegate;
65
66
67#pragma mark - Get Group
68
81- (NSArray<EMGroup *> *_Nullable )getJoinedGroups;
82
93
109- (NSArray *)getGroupsWithoutPushNotification:(EMError **)pError EM_DEPRECATED_IOS(3_3_2, 3_8_3, "Use -IEMPushManager::noPushGroups");
110
111
112#pragma mark - Get group from server
113
137- (EMCursorResult<EMGroup*> *_Nullable)getPublicGroupsFromServerWithCursor:(NSString *_Nullable)aCursor
138 pageSize:(NSInteger)aPageSize
139 error:(EMError **_Nullable)pError;
140
162- (void)getPublicGroupsFromServerWithCursor:(NSString *_Nullable)aCursor
163 pageSize:(NSInteger)aPageSize
164 completion:(void (^_Nullable)(EMCursorResult<EMGroup*> *_Nullable aResult, EMError *_Nullable aError))aCompletionBlock;
165
187- (EMGroup * _Nullable)searchPublicGroupWithId:(NSString *_Nonnull)aGroundId
188 error:(EMError **_Nullable)pError;
189
205- (void)searchPublicGroupWithId:(NSString *_Nonnull)aGroundId
206 completion:(void (^_Nullable)(EMGroup *aGroup, EMError *_Nullable aError))aCompletionBlock;
207
225- (void)getJoinedGroupsCountFromServerWithCompletion:(void (^_Nullable)(NSInteger groupCount, EMError *_Nullable aError))aCompletionBlock;
226
227#pragma mark - Create
228
258- (EMGroup * _Nullable)createGroupWithSubject:(NSString *_Nullable)aSubject
259 description:(NSString *_Nullable)aDescription
260 invitees:(NSArray<NSString *> * _Nullable)aInvitees
261 message:(NSString *_Nullable)aMessage
262 setting:(EMGroupOptions *_Nullable)aSetting
263 error:(EMError **_Nullable)pError;
264
292- (void)createGroupWithSubject:(NSString *_Nullable)aSubject
293 description:(NSString *_Nullable)aDescription
294 invitees:(NSArray<NSString *> * _Nullable)aInvitees
295 message:(NSString *_Nullable)aMessage
296 setting:(EMGroupOptions *_Nullable)aSetting
297 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
298
299#pragma mark - Fetch Info
300
322- (EMGroup * _Nullable)getGroupSpecificationFromServerWithId:(NSString *_Nonnull)aGroupId
323 error:(EMError **_Nullable)pError;
324
348- (EMGroup * _Nullable)getGroupSpecificationFromServerWithId:(NSString *_Nonnull)aGroupId
349 fetchMembers:(BOOL)fetchMembers
350 error:(EMError **_Nullable)pError;
351
371- (void)getGroupSpecificationFromServerWithId:(NSString *_Nonnull)aGroupId
372 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
373
393- (void)getGroupSpecificationFromServerWithId:(NSString *_Nonnull)aGroupId
394 fetchMembers:(BOOL)fetchMembers
395 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
396
428- (EMCursorResult<NSString*> *)getGroupMemberListFromServerWithId:(NSString *_Nonnull)aGroupId
429 cursor:(NSString *_Nullable)aCursor
430 pageSize:(NSInteger)aPageSize
431 error:(EMError **_Nullable)pError;
432
456- (void)getGroupMemberListFromServerWithId:(NSString *_Nonnull)aGroupId
457 cursor:(NSString *_Nullable)aCursor
458 pageSize:(NSInteger)aPageSize
459 completion:(void (^_Nullable)(EMCursorResult<NSString*> *aResult, EMError *_Nullable aError))aCompletionBlock;
460
490- (NSArray<NSString *> * _Nullable)getGroupBlacklistFromServerWithId:(NSString *_Nonnull)aGroupId
491 pageNumber:(NSInteger)aPageNum
492 pageSize:(NSInteger)aPageSize
493 error:(EMError **_Nullable)pError;
494
518- (void)getGroupBlacklistFromServerWithId:(NSString *_Nonnull)aGroupId
519 pageNumber:(NSInteger)aPageNum
520 pageSize:(NSInteger)aPageSize
521 completion:(void (^_Nullable)(NSArray<NSString *> * _Nullable aList, EMError *_Nullable aError))aCompletionBlock;
522
549- (NSArray<NSString *> * _Nullable)getGroupMuteListFromServerWithId:(NSString *_Nonnull)aGroupId
550 pageNumber:(NSInteger)aPageNum
551 pageSize:(NSInteger)aPageSize
552 error:(EMError **_Nullable)pError;
553
577- (void)getGroupMuteListFromServerWithId:(NSString *_Nonnull)aGroupId
578 pageNumber:(NSInteger)aPageNum
579 pageSize:(NSInteger)aPageSize
580 completion:(void (^_Nullable)(NSArray<NSString *> * _Nullable aList, EMError *_Nullable aError))aCompletionBlock;
581
605- (void)fetchGroupMuteListFromServerWithId:(NSString *_Nonnull)aGroupId
606 pageNumber:(NSInteger)aPageNum
607 pageSize:(NSInteger)aPageSize
608 completion:(void (^_Nullable)(NSDictionary<NSString *, NSNumber *> *_Nullable aDict, EMError *_Nullable aError))aCompletionBlock;
609
631- (NSArray<EMGroupSharedFile *> *_Nullable)getGroupFileListWithId:(NSString *_Nonnull)aGroupId
632 pageNumber:(NSInteger)aPageNum
633 pageSize:(NSInteger)aPageSize
634 error:(EMError **_Nullable)pError;
635
657- (void)getGroupFileListWithId:(NSString *_Nonnull)aGroupId
658 pageNumber:(NSInteger)aPageNum
659 pageSize:(NSInteger)aPageSize
660 completion:(void (^_Nullable)(NSArray<EMGroupSharedFile *> *_Nullable aList, EMError *_Nullable aError))aCompletionBlock;
661
662
682- (NSArray *)getGroupWhiteListFromServerWithId:(NSString *_Nonnull)aGroupId
683 error:(EMError **_Nullable)pError;
684
685
701- (void)getGroupWhiteListFromServerWithId:(NSString *_Nonnull)aGroupId
702 completion:(void (^_Nullable)(NSArray<NSString *> * _Nullable aList, EMError *_Nullable aError))aCompletionBlock;
703
723- (BOOL)isMemberInWhiteListFromServerWithGroupId:(NSString *_Nonnull)aGroupId
724 error:(EMError **_Nullable)pError;
725
741- (void)isMemberInWhiteListFromServerWithGroupId:(NSString *_Nonnull)aGroupId
742 completion:(void (^_Nullable)(BOOL inWhiteList, EMError *_Nullable aError))aCompletionBlock;
743
761- (NSString *_Nullable)getGroupAnnouncementWithId:(NSString *_Nonnull)aGroupId
762 error:(EMError **_Nullable)pError;
763
779- (void)isMemberInMuteListFromServerWithGroupId:(NSString * _Nonnull)aGroupId
780 completion:(void (^ _Nonnull)(BOOL inMuteList, EMError * _Nullable aError))aCompletionBlock;
781
797- (void)getGroupAnnouncementWithId:(NSString *_Nonnull)aGroupId
798 completion:(void (^_Nullable)(NSString *aAnnouncement, EMError *_Nullable aError))aCompletionBlock;
799
800#pragma mark - Edit Group
801
827- (EMGroup * _Nullable)addOccupants:(NSArray<NSString *> * _Nonnull)aOccupants
828 toGroup:(NSString *_Nonnull)aGroupId
829 welcomeMessage:(NSString *_Nullable)aWelcomeMessage
830 error:(EMError **_Nullable)pError;
831
851- (void)addMembers:(NSArray<NSString *> * _Nonnull)aUsers
852 toGroup:(NSString *_Nonnull)aGroupId
853 message:(NSString *_Nullable)aMessage
854 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
855
883- (EMGroup * _Nullable)removeOccupants:(NSArray<NSString *> * _Nonnull)aOccupants
884 fromGroup:(NSString *_Nonnull)aGroupId
885 error:(EMError **_Nullable)pError;
886
908- (void)removeMembers:(NSArray<NSString *> * _Nonnull)aUsers
909 fromGroup:(NSString *_Nonnull)aGroupId
910 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
911
939- (EMGroup * _Nullable)blockOccupants:(NSArray<NSString *> * _Nonnull)aOccupants
940 fromGroup:(NSString *_Nonnull)aGroupId
941 error:(EMError **_Nullable)pError;
942
964- (void)blockMembers:(NSArray<NSString *> * _Nonnull)aMembers
965 fromGroup:(NSString *_Nonnull)aGroupId
966 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
967
968
996- (EMGroup * _Nullable)unblockOccupants:(NSArray<NSString *> * _Nonnull)aOccupants
997 forGroup:(NSString *_Nonnull)aGroupId
998 error:(EMError **_Nullable)pError;
999
1021- (void)unblockMembers:(NSArray<NSString *> * _Nonnull)aMembers
1022 fromGroup:(NSString *_Nonnull)aGroupId
1023 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
1024
1052- (EMGroup * _Nullable)changeGroupSubject:(NSString *_Nullable)aSubject
1053 forGroup:(NSString *_Nonnull)aGroupId
1054 error:(EMError **_Nullable)pError;
1055
1077- (void)updateGroupSubject:(NSString *_Nullable)aSubject
1078 forGroup:(NSString *_Nonnull)aGroupId
1079 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
1080
1108- (EMGroup * _Nullable)changeDescription:(NSString *_Nullable)aDescription
1109 forGroup:(NSString *_Nonnull)aGroupId
1110 error:(EMError **_Nullable)pError;
1111
1133- (void)updateDescription:(NSString *_Nullable)aDescription
1134 forGroup:(NSString *_Nonnull)aGroupId
1135 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
1136
1156- (void)leaveGroup:(NSString *_Nonnull)aGroupId
1157 error:(EMError **_Nullable)pError;
1158
1174- (void)leaveGroup:(NSString *_Nonnull)aGroupId
1175 completion:(void (^_Nullable)(EMError *_Nullable aError))aCompletionBlock;
1176
1200- (EMError *)destroyGroup:(NSString *_Nonnull)aGroupId;
1201
1220- (void)destroyGroup:(NSString *_Nonnull)aGroupId
1221 finishCompletion:(void (^_Nullable)(EMError *_Nullable aError))aCompletionBlock;
1222
1223
1247- (EMGroup * _Nullable)blockGroup:(NSString *_Nonnull)aGroupId
1248 error:(EMError **_Nullable)pError;
1249
1266- (void)blockGroup:(NSString *_Nonnull)aGroupId
1267 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
1268
1290- (EMGroup * _Nullable)unblockGroup:(NSString *_Nonnull)aGroupId
1291 error:(EMError **_Nullable)pError;
1292
1307- (void)unblockGroup:(NSString *_Nonnull)aGroupId
1308 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
1309
1310
1338- (EMGroup * _Nullable)updateGroupOwner:(NSString *_Nonnull)aGroupId
1339 newOwner:(NSString *_Nonnull)aNewOwner
1340 error:(EMError **_Nullable)pError;
1341
1363- (void)updateGroupOwner:(NSString *_Nonnull)aGroupId
1364 newOwner:(NSString *_Nonnull)aNewOwner
1365 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
1366
1392- (EMGroup * _Nullable)addAdmin:(NSString *_Nonnull)aAdmin
1393 toGroup:(NSString *_Nonnull)aGroupId
1394 error:(EMError **_Nullable)pError;
1395
1421- (void)addAdmin:(NSString *_Nonnull)aAdmin
1422 toGroup:(NSString *_Nonnull)aGroupId
1423 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
1424
1452- (EMGroup * _Nullable)removeAdmin:(NSString *_Nonnull)aAdmin
1453 fromGroup:(NSString *_Nonnull)aGroupId
1454 error:(EMError **_Nullable)pError;
1455
1481- (void)removeAdmin:(NSString *_Nonnull)aAdmin
1482 fromGroup:(NSString *_Nonnull)aGroupId
1483 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
1484
1485
1515- (EMGroup * _Nullable)muteMembers:(NSArray<NSString *> * _Nonnull)aMuteMembers
1516 muteMilliseconds:(NSInteger)aMuteMilliseconds
1517 fromGroup:(NSString *_Nonnull)aGroupId
1518 error:(EMError **_Nullable)pError;
1519
1546- (void)muteMembers:(NSArray<NSString *> * _Nonnull)aMuteMembers
1547 muteMilliseconds:(NSInteger)aMuteMilliseconds
1548 fromGroup:(NSString *_Nonnull)aGroupId
1549 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
1550
1578- (EMGroup * _Nullable)unmuteMembers:(NSArray<NSString *> * _Nonnull)aMembers
1579 fromGroup:(NSString *_Nonnull)aGroupId
1580 error:(EMError **_Nullable)pError;
1581
1606- (void)unmuteMembers:(NSArray<NSString *> * _Nonnull)aMembers
1607 fromGroup:(NSString *_Nonnull)aGroupId
1608 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
1609
1635- (EMGroup * _Nullable)muteAllMembersFromGroup:(NSString *_Nonnull)aGroupId
1636 error:(EMError **_Nullable)pError;
1637
1660- (void)muteAllMembersFromGroup:(NSString *_Nonnull)aGroupId
1661 completion:(void(^)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
1662
1663
1689- (EMGroup * _Nullable)unmuteAllMembersFromGroup:(NSString *_Nonnull)aGroupId
1690 error:(EMError **_Nullable)pError;
1691
1692
1715- (void)unmuteAllMembersFromGroup:(NSString *_Nonnull)aGroupId
1716 completion:(void(^)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
1717
1718
1746- (EMGroup * _Nullable)addWhiteListMembers:(NSArray<NSString *> * _Nonnull)aMembers
1747 fromGroup:(NSString *_Nonnull)aGroupId
1748 error:(EMError **_Nullable)pError;
1749
1772- (void)addWhiteListMembers:(NSArray<NSString *> * _Nonnull)aMembers
1773 fromGroup:(NSString *_Nonnull)aGroupId
1774 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
1775
1776
1804- (EMGroup * _Nullable)removeWhiteListMembers:(NSArray<NSString *> * _Nonnull)aMembers
1805 fromGroup:(NSString *_Nonnull)aGroupId
1806 error:(EMError **_Nullable)pError;
1807
1832- (void)removeWhiteListMembers:(NSArray<NSString *> * _Nonnull)aMembers
1833 fromGroup:(NSString *_Nonnull)aGroupId
1834 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
1835
1855- (void)uploadGroupSharedFileWithId:(NSString *_Nonnull)aGroupId
1856 filePath:(NSString* _Nonnull)aFilePath
1857 progress:(void (^_Nullable)(int progress))aProgressBlock
1858 completion:(void (^_Nullable)(EMGroupSharedFile *_Nullable aSharedFile, EMError *_Nullable aError))aCompletionBlock;
1859
1879- (void)downloadGroupSharedFileWithId:(NSString *_Nonnull)aGroupId
1880 filePath:(NSString *_Nonnull)aFilePath
1881 sharedFileId:(NSString *_Nonnull)aSharedFileId
1882 progress:(void (^_Nullable)(int progress))aProgressBlock
1883 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
1884
1906- (EMGroup * _Nullable)removeGroupSharedFileWithId:(NSString *_Nonnull)aGroupId
1907 sharedFileId:(NSString *_Nonnull)aSharedFileId
1908 error:(EMError **_Nullable)pError;
1909
1925- (void)removeGroupSharedFileWithId:(NSString *_Nonnull)aGroupId
1926 sharedFileId:(NSString *_Nonnull)aSharedFileId
1927 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
1928
1954- (EMGroup * _Nullable)updateGroupAnnouncementWithId:(NSString *_Nonnull)aGroupId
1955 announcement:(NSString *_Nullable)aAnnouncement
1956 error:(EMError **_Nullable)pError;
1957
1982- (void)updateGroupAnnouncementWithId:(NSString *_Nonnull)aGroupId
1983 announcement:(NSString *_Nullable)aAnnouncement
1984 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
1985
2011- (EMGroup * _Nullable)updateGroupExtWithId:(NSString *_Nonnull)aGroupId
2012 ext:(NSString *_Nullable)aExt
2013 error:(EMError **_Nullable)pError;
2014
2035- (void)updateGroupExtWithId:(NSString *_Nonnull)aGroupId
2036 ext:(NSString *_Nullable)aExt
2037 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
2038
2039#pragma mark - Edit Public Group
2040
2062- (EMGroup * _Nullable)joinPublicGroup:(NSString *_Nonnull)aGroupId
2063 error:(EMError **_Nullable)pError;
2064
2079- (void)joinPublicGroup:(NSString *_Nonnull)aGroupId
2080 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
2081
2105- (EMGroup * _Nullable)applyJoinPublicGroup:(NSString *_Nonnull)aGroupId
2106 message:(NSString *_Nullable)aMessage
2107 error:(EMError **_Nullable)pError;
2108
2126- (void)requestToJoinPublicGroup:(NSString *_Nonnull)aGroupId
2127 message:(NSString *_Nullable)aMessage
2128 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
2129
2130#pragma mark - Application
2131
2157- (EMError *)acceptJoinApplication:(NSString *_Nonnull)aGroupId
2158 applicant:(NSString *_Nonnull)aUsername;
2159
2185- (void)approveJoinGroupRequest:(NSString *_Nonnull)aGroupId
2186 sender:(NSString *_Nonnull)aUsername
2187 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
2188
2216- (EMError *)declineJoinApplication:(NSString *_Nonnull)aGroupId
2217 applicant:(NSString *_Nonnull)aUsername
2218 reason:(NSString *_Nullable)aReason;
2219
2247- (void)declineJoinGroupRequest:(NSString *_Nonnull)aGroupId
2248 sender:(NSString *_Nonnull)aUsername
2249 reason:(NSString *_Nullable)aReason
2250 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
2251
2275- (EMGroup * _Nullable)acceptInvitationFromGroup:(NSString *_Nonnull)aGroupId
2276 inviter:(NSString *_Nonnull)aUsername
2277 error:(EMError **_Nullable)pError;
2278
2301- (void)acceptInvitationFromGroup:(NSString *_Nonnull)aGroupId
2302 inviter:(NSString *_Nonnull)aUsername
2303 completion:(void (^_Nullable)(EMGroup *_Nullable aGroup, EMError *_Nullable aError))aCompletionBlock;
2304
2328- (EMError *)declineInvitationFromGroup:(NSString *_Nonnull)aGroupId
2329 inviter:(NSString *_Nonnull)aUsername
2330 reason:(NSString *_Nullable)aReason;
2331
2355- (void)declineGroupInvitation:(NSString *_Nonnull)aGroupId
2356 inviter:(NSString *_Nonnull)aInviter
2357 reason:(NSString *_Nullable)aReason
2358 completion:(void (^_Nullable)(EMError *_Nullable aError))aCompletionBlock;
2359
2398- (void)getJoinedGroupsFromServerWithPage:(NSInteger)aPageNum
2399 pageSize:(NSInteger)aPageSize
2400 needMemberCount:(BOOL)aNeedMemberCount
2401 needRole:(BOOL)aNeedRole
2402 completion:(void (^_Nullable)(NSArray<EMGroup *> *_Nullable aList, EMError *_Nullable aError))aCompletionBlock;
2403
2404#pragma mark - Group member attributes
2422- (void)setMemberAttribute:(NSString *_Nonnull)groupId userId:(NSString *_Nonnull)userId attributes:(NSDictionary<NSString*,NSString*> *_Nonnull)attributes completion:(void (^_Nullable)(EMError *_Nullable error))completionBlock;
2423
2445- (void)fetchMemberAttribute:(NSString *_Nonnull)groupId userId:(NSString *_Nonnull)userId completion:(void (^ _Nullable)(NSDictionary<NSString *,NSString *> * _Nullable, EMError * _Nullable))completionBlock;
2470- (void)fetchMembersAttributes:(NSString *_Nonnull)groupId userIds:(NSArray<__kindof NSString *> *_Nonnull)userIds keys:(NSArray<__kindof NSString *> *_Nonnull)keys completion:(void (^_Nullable)(NSDictionary<NSString*,NSDictionary<NSString*,NSString*>*> *_Nullable attributes, EMError *_Nullable error))completionBlock;
2471
2472@end
Definition: EMCursorResult.h:27
Definition: EMError.h:27
Definition: EMGroup.h:43
Definition: EMGroupOptions.h:42
Definition: EMGroupSharedFile.h:24
Definition: EMGroupManagerDelegate.h:40
Definition: IEMGroupManager.h:31
NSArray< EMGroup * > *_Nullable getJoinedGroups()
Definition: IEMPushManager.h:31