15#import <Foundation/Foundation.h>
17#import "EMCommonDefs.h"
18#import "EMGroupManagerDelegate.h"
20#import "EMGroupOptions.h"
21#import "EMCursorResult.h"
22#import "EMGroupSharedFile.h"
35#pragma mark - Delegate
51 delegateQueue:(dispatch_queue_t _Nullable )aQueue;
64- (void)removeDelegate:(
id _Nonnull)aDelegate;
67#pragma mark - Get Group
109- (NSArray *)getGroupsWithoutPushNotification:(
EMError **)pError EM_DEPRECATED_IOS(3_3_2, 3_8_3, "Use -
IEMPushManager::noPushGroups");
112#pragma mark - Get group from server
137- (
EMCursorResult<
EMGroup*> *_Nullable)getPublicGroupsFromServerWithCursor:(NSString *_Nullable)aCursor
138 pageSize:(NSInteger)aPageSize
139 error:(
EMError **_Nullable)pError;
162- (void)getPublicGroupsFromServerWithCursor:(NSString *_Nullable)aCursor
163 pageSize:(NSInteger)aPageSize
187- (
EMGroup * _Nullable)searchPublicGroupWithId:(NSString *_Nonnull)aGroundId
188 error:(
EMError **_Nullable)pError;
205- (void)searchPublicGroupWithId:(NSString *_Nonnull)aGroundId
206 completion:(
void (^_Nullable)(
EMGroup *aGroup,
EMError *_Nullable aError))aCompletionBlock;
225- (void)getJoinedGroupsCountFromServerWithCompletion:(
void (^_Nullable)(NSInteger groupCount,
EMError *_Nullable aError))aCompletionBlock;
258- (
EMGroup * _Nullable)createGroupWithSubject:(NSString *_Nullable)aSubject
259 description:(NSString *_Nullable)aDescription
260 invitees:(NSArray<NSString *> * _Nullable)aInvitees
261 message:(NSString *_Nullable)aMessage
263 error:(
EMError **_Nullable)pError;
292- (void)createGroupWithSubject:(NSString *_Nullable)aSubject
293 description:(NSString *_Nullable)aDescription
294 invitees:(NSArray<NSString *> * _Nullable)aInvitees
295 message:(NSString *_Nullable)aMessage
297 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
299#pragma mark - Fetch Info
322- (
EMGroup * _Nullable)getGroupSpecificationFromServerWithId:(NSString *_Nonnull)aGroupId
323 error:(
EMError **_Nullable)pError;
348- (
EMGroup * _Nullable)getGroupSpecificationFromServerWithId:(NSString *_Nonnull)aGroupId
349 fetchMembers:(BOOL)fetchMembers
350 error:(
EMError **_Nullable)pError;
371- (void)getGroupSpecificationFromServerWithId:(NSString *_Nonnull)aGroupId
372 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
393- (void)getGroupSpecificationFromServerWithId:(NSString *_Nonnull)aGroupId
394 fetchMembers:(BOOL)fetchMembers
395 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
428- (
EMCursorResult<NSString*> *)getGroupMemberListFromServerWithId:(NSString *_Nonnull)aGroupId
429 cursor:(NSString *_Nullable)aCursor
430 pageSize:(NSInteger)aPageSize
431 error:(
EMError **_Nullable)pError;
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;
490- (NSArray<NSString *> * _Nullable)getGroupBlacklistFromServerWithId:(NSString *_Nonnull)aGroupId
491 pageNumber:(NSInteger)aPageNum
492 pageSize:(NSInteger)aPageSize
493 error:(
EMError **_Nullable)pError;
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;
549- (NSArray<NSString *> * _Nullable)getGroupMuteListFromServerWithId:(NSString *_Nonnull)aGroupId
550 pageNumber:(NSInteger)aPageNum
551 pageSize:(NSInteger)aPageSize
552 error:(
EMError **_Nullable)pError;
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;
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;
631- (NSArray<
EMGroupSharedFile *> *_Nullable)getGroupFileListWithId:(NSString *_Nonnull)aGroupId
632 pageNumber:(NSInteger)aPageNum
633 pageSize:(NSInteger)aPageSize
634 error:(
EMError **_Nullable)pError;
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;
682- (NSArray *)getGroupWhiteListFromServerWithId:(NSString *_Nonnull)aGroupId
683 error:(
EMError **_Nullable)pError;
701- (void)getGroupWhiteListFromServerWithId:(NSString *_Nonnull)aGroupId
702 completion:(
void (^_Nullable)(NSArray<NSString *> * _Nullable aList,
EMError *_Nullable aError))aCompletionBlock;
723- (BOOL)isMemberInWhiteListFromServerWithGroupId:(NSString *_Nonnull)aGroupId
724 error:(
EMError **_Nullable)pError;
741- (void)isMemberInWhiteListFromServerWithGroupId:(NSString *_Nonnull)aGroupId
742 completion:(
void (^_Nullable)(BOOL inWhiteList,
EMError *_Nullable aError))aCompletionBlock;
761- (NSString *_Nullable)getGroupAnnouncementWithId:(NSString *_Nonnull)aGroupId
762 error:(
EMError **_Nullable)pError;
779- (void)isMemberInMuteListFromServerWithGroupId:(NSString * _Nonnull)aGroupId
780 completion:(
void (^ _Nonnull)(BOOL inMuteList,
EMError * _Nullable aError))aCompletionBlock;
797- (void)getGroupAnnouncementWithId:(NSString *_Nonnull)aGroupId
798 completion:(
void (^_Nullable)(NSString *aAnnouncement,
EMError *_Nullable aError))aCompletionBlock;
800#pragma mark - Edit Group
827- (
EMGroup * _Nullable)addOccupants:(NSArray<NSString *> * _Nonnull)aOccupants
828 toGroup:(NSString *_Nonnull)aGroupId
829 welcomeMessage:(NSString *_Nullable)aWelcomeMessage
830 error:(
EMError **_Nullable)pError;
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;
883- (
EMGroup * _Nullable)removeOccupants:(NSArray<NSString *> * _Nonnull)aOccupants
884 fromGroup:(NSString *_Nonnull)aGroupId
885 error:(
EMError **_Nullable)pError;
908- (void)removeMembers:(NSArray<NSString *> * _Nonnull)aUsers
909 fromGroup:(NSString *_Nonnull)aGroupId
910 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
939- (
EMGroup * _Nullable)blockOccupants:(NSArray<NSString *> * _Nonnull)aOccupants
940 fromGroup:(NSString *_Nonnull)aGroupId
941 error:(
EMError **_Nullable)pError;
964- (void)blockMembers:(NSArray<NSString *> * _Nonnull)aMembers
965 fromGroup:(NSString *_Nonnull)aGroupId
966 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
996- (
EMGroup * _Nullable)unblockOccupants:(NSArray<NSString *> * _Nonnull)aOccupants
997 forGroup:(NSString *_Nonnull)aGroupId
998 error:(
EMError **_Nullable)pError;
1021- (void)unblockMembers:(NSArray<NSString *> * _Nonnull)aMembers
1022 fromGroup:(NSString *_Nonnull)aGroupId
1023 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
1052- (
EMGroup * _Nullable)changeGroupSubject:(NSString *_Nullable)aSubject
1053 forGroup:(NSString *_Nonnull)aGroupId
1054 error:(
EMError **_Nullable)pError;
1077- (void)updateGroupSubject:(NSString *_Nullable)aSubject
1078 forGroup:(NSString *_Nonnull)aGroupId
1079 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
1108- (
EMGroup * _Nullable)changeDescription:(NSString *_Nullable)aDescription
1109 forGroup:(NSString *_Nonnull)aGroupId
1110 error:(
EMError **_Nullable)pError;
1133- (void)updateDescription:(NSString *_Nullable)aDescription
1134 forGroup:(NSString *_Nonnull)aGroupId
1135 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
1156- (void)leaveGroup:(NSString *_Nonnull)aGroupId
1157 error:(
EMError **_Nullable)pError;
1174- (void)leaveGroup:(NSString *_Nonnull)aGroupId
1175 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
1200- (
EMError *)destroyGroup:(NSString *_Nonnull)aGroupId;
1220- (void)destroyGroup:(NSString *_Nonnull)aGroupId
1221 finishCompletion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
1247- (
EMGroup * _Nullable)blockGroup:(NSString *_Nonnull)aGroupId
1248 error:(
EMError **_Nullable)pError;
1266- (void)blockGroup:(NSString *_Nonnull)aGroupId
1267 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
1290- (
EMGroup * _Nullable)unblockGroup:(NSString *_Nonnull)aGroupId
1291 error:(
EMError **_Nullable)pError;
1307- (void)unblockGroup:(NSString *_Nonnull)aGroupId
1308 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
1338- (
EMGroup * _Nullable)updateGroupOwner:(NSString *_Nonnull)aGroupId
1339 newOwner:(NSString *_Nonnull)aNewOwner
1340 error:(
EMError **_Nullable)pError;
1363- (void)updateGroupOwner:(NSString *_Nonnull)aGroupId
1364 newOwner:(NSString *_Nonnull)aNewOwner
1365 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
1392- (
EMGroup * _Nullable)addAdmin:(NSString *_Nonnull)aAdmin
1393 toGroup:(NSString *_Nonnull)aGroupId
1394 error:(
EMError **_Nullable)pError;
1421- (void)addAdmin:(NSString *_Nonnull)aAdmin
1422 toGroup:(NSString *_Nonnull)aGroupId
1423 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
1452- (
EMGroup * _Nullable)removeAdmin:(NSString *_Nonnull)aAdmin
1453 fromGroup:(NSString *_Nonnull)aGroupId
1454 error:(
EMError **_Nullable)pError;
1481- (void)removeAdmin:(NSString *_Nonnull)aAdmin
1482 fromGroup:(NSString *_Nonnull)aGroupId
1483 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
1515- (
EMGroup * _Nullable)muteMembers:(NSArray<NSString *> * _Nonnull)aMuteMembers
1516 muteMilliseconds:(NSInteger)aMuteMilliseconds
1517 fromGroup:(NSString *_Nonnull)aGroupId
1518 error:(
EMError **_Nullable)pError;
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;
1578- (
EMGroup * _Nullable)unmuteMembers:(NSArray<NSString *> * _Nonnull)aMembers
1579 fromGroup:(NSString *_Nonnull)aGroupId
1580 error:(
EMError **_Nullable)pError;
1606- (void)unmuteMembers:(NSArray<NSString *> * _Nonnull)aMembers
1607 fromGroup:(NSString *_Nonnull)aGroupId
1608 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
1635- (
EMGroup * _Nullable)muteAllMembersFromGroup:(NSString *_Nonnull)aGroupId
1636 error:(
EMError **_Nullable)pError;
1660- (void)muteAllMembersFromGroup:(NSString *_Nonnull)aGroupId
1661 completion:(
void(^)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
1689- (
EMGroup * _Nullable)unmuteAllMembersFromGroup:(NSString *_Nonnull)aGroupId
1690 error:(
EMError **_Nullable)pError;
1715- (void)unmuteAllMembersFromGroup:(NSString *_Nonnull)aGroupId
1716 completion:(
void(^)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
1746- (
EMGroup * _Nullable)addWhiteListMembers:(NSArray<NSString *> * _Nonnull)aMembers
1747 fromGroup:(NSString *_Nonnull)aGroupId
1748 error:(
EMError **_Nullable)pError;
1772- (void)addWhiteListMembers:(NSArray<NSString *> * _Nonnull)aMembers
1773 fromGroup:(NSString *_Nonnull)aGroupId
1774 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
1804- (
EMGroup * _Nullable)removeWhiteListMembers:(NSArray<NSString *> * _Nonnull)aMembers
1805 fromGroup:(NSString *_Nonnull)aGroupId
1806 error:(
EMError **_Nullable)pError;
1832- (void)removeWhiteListMembers:(NSArray<NSString *> * _Nonnull)aMembers
1833 fromGroup:(NSString *_Nonnull)aGroupId
1834 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
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;
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;
1906- (
EMGroup * _Nullable)removeGroupSharedFileWithId:(NSString *_Nonnull)aGroupId
1907 sharedFileId:(NSString *_Nonnull)aSharedFileId
1908 error:(
EMError **_Nullable)pError;
1925- (void)removeGroupSharedFileWithId:(NSString *_Nonnull)aGroupId
1926 sharedFileId:(NSString *_Nonnull)aSharedFileId
1927 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
1954- (
EMGroup * _Nullable)updateGroupAnnouncementWithId:(NSString *_Nonnull)aGroupId
1955 announcement:(NSString *_Nullable)aAnnouncement
1956 error:(
EMError **_Nullable)pError;
1982- (void)updateGroupAnnouncementWithId:(NSString *_Nonnull)aGroupId
1983 announcement:(NSString *_Nullable)aAnnouncement
1984 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
2011- (
EMGroup * _Nullable)updateGroupExtWithId:(NSString *_Nonnull)aGroupId
2012 ext:(NSString *_Nullable)aExt
2013 error:(
EMError **_Nullable)pError;
2035- (void)updateGroupExtWithId:(NSString *_Nonnull)aGroupId
2036 ext:(NSString *_Nullable)aExt
2037 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
2039#pragma mark - Edit Public Group
2062- (
EMGroup * _Nullable)joinPublicGroup:(NSString *_Nonnull)aGroupId
2063 error:(
EMError **_Nullable)pError;
2079- (void)joinPublicGroup:(NSString *_Nonnull)aGroupId
2080 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
2105- (
EMGroup * _Nullable)applyJoinPublicGroup:(NSString *_Nonnull)aGroupId
2106 message:(NSString *_Nullable)aMessage
2107 error:(
EMError **_Nullable)pError;
2126- (void)requestToJoinPublicGroup:(NSString *_Nonnull)aGroupId
2127 message:(NSString *_Nullable)aMessage
2128 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
2130#pragma mark - Application
2157- (
EMError *)acceptJoinApplication:(NSString *_Nonnull)aGroupId
2158 applicant:(NSString *_Nonnull)aUsername;
2185- (void)approveJoinGroupRequest:(NSString *_Nonnull)aGroupId
2186 sender:(NSString *_Nonnull)aUsername
2187 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
2216- (
EMError *)declineJoinApplication:(NSString *_Nonnull)aGroupId
2217 applicant:(NSString *_Nonnull)aUsername
2218 reason:(NSString *_Nullable)aReason;
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;
2275- (
EMGroup * _Nullable)acceptInvitationFromGroup:(NSString *_Nonnull)aGroupId
2276 inviter:(NSString *_Nonnull)aUsername
2277 error:(
EMError **_Nullable)pError;
2301- (void)acceptInvitationFromGroup:(NSString *_Nonnull)aGroupId
2302 inviter:(NSString *_Nonnull)aUsername
2303 completion:(
void (^_Nullable)(
EMGroup *_Nullable aGroup,
EMError *_Nullable aError))aCompletionBlock;
2328- (
EMError *)declineInvitationFromGroup:(NSString *_Nonnull)aGroupId
2329 inviter:(NSString *_Nonnull)aUsername
2330 reason:(NSString *_Nullable)aReason;
2355- (void)declineGroupInvitation:(NSString *_Nonnull)aGroupId
2356 inviter:(NSString *_Nonnull)aInviter
2357 reason:(NSString *_Nullable)aReason
2358 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
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;
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;
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;
Definition: EMCursorResult.h:27
Definition: EMGroupOptions.h:42
Definition: EMGroupSharedFile.h:24
Definition: EMGroupManagerDelegate.h:40
Definition: IEMGroupManager.h:31
void cleanAllGroupsFromDB()
NSArray< EMGroup * > *_Nullable getJoinedGroups()
Definition: IEMPushManager.h:31