HyphenateSDK  3.1.4
Instance Methods | List of all members
<IEMGroupManager> Protocol Reference

#import <IEMGroupManager.h>

Inheritance diagram for <IEMGroupManager>:

Instance Methods

(void) - addDelegate:delegateQueue:
 
(void) - removeDelegate:
 
(NSArray *) - getAllGroups
 
(NSArray *) - loadAllMyGroupsFromDB
 
(NSArray *) - getAllIgnoredGroupIds
 
(NSArray *) - getMyGroupsFromServerWithError:
 
(EMCursorResult *) - getPublicGroupsFromServerWithCursor:pageSize:error:
 
(EMGroup *) - searchPublicGroupWithId:error:
 
(EMGroup *) - createGroupWithSubject:description:invitees:message:setting:error:
 
(EMGroup *) - fetchGroupInfo:includeMembersList:error:
 
(NSArray *) - fetchGroupBansList:error:
 
(EMGroup *) - addOccupants:toGroup:welcomeMessage:error:
 
(EMGroup *) - removeOccupants:fromGroup:error:
 
(EMGroup *) - blockOccupants:fromGroup:error:
 
(EMGroup *) - unblockOccupants:forGroup:error:
 
(EMGroup *) - changeGroupSubject:forGroup:error:
 
(EMGroup *) - changeDescription:forGroup:error:
 
(EMGroup *) - leaveGroup:error:
 
(EMGroup *) - destroyGroup:error:
 
(EMGroup *) - blockGroup:error:
 
(EMGroup *) - unblockGroup:error:
 
(EMGroup *) - joinPublicGroup:error:
 
(EMGroup *) - applyJoinPublicGroup:message:error:
 
(EMError *) - acceptJoinApplication:applicant:
 
(EMError *) - declineJoinApplication:applicant:reason:
 
(EMGroup *) - acceptInvitationFromGroup:inviter:error:
 
(EMError *) - declineInvitationFromGroup:inviter:reason:
 
(EMError *) - ignoreGroupPush:ignore:
 
(void) - asyncGetMyGroupsFromServer:failure:
 
(void) - asyncGetPublicGroupsFromServerWithCursor:pageSize:success:failure:
 
(void) - asyncSearchPublicGroupWithId:success:failure:
 
(void) - asyncCreateGroupWithSubject:description:invitees:message:setting:success:failure:
 
(void) - asyncFetchGroupInfo:includeMembersList:success:failure:
 
(void) - asyncFetchGroupBansList:success:failure:
 
(void) - asyncAddOccupants:toGroup:welcomeMessage:success:failure:
 
(void) - asyncRemoveOccupants:fromGroup:success:failure:
 
(void) - asyncBlockOccupants:fromGroup:success:failure:
 
(void) - asyncUnblockOccupants:forGroup:success:failure:
 
(void) - asyncChangeGroupSubject:forGroup:success:failure:
 
(void) - asyncChangeDescription:forGroup:success:failure:
 
(void) - asyncLeaveGroup:success:failure:
 
(void) - asyncDestroyGroup:success:failure:
 
(void) - asyncBlockGroup:success:failure:
 
(void) - asyncUnblockGroup:success:failure:
 
(void) - asyncJoinPublicGroup:success:failure:
 
(void) - asyncApplyJoinPublicGroup:message:success:failure:
 
(void) - asyncAcceptJoinApplication:applicant:success:failure:
 
(void) - asyncDeclineJoinApplication:applicant:reason:success:failure:
 
(void) - asyncAcceptInvitationFromGroup:inviter:success:failure:
 
(void) - asyncDeclineInvitationFromGroup:inviter:reason:success:failure:
 
(void) - asyncIgnoreGroupPush:ignore:success:failure:
 

Detailed Description

IEMGroupManager.h This protocol defined the group operations

Author
Hyphenate
Version
3.00

Group operations

Method Documentation

- (EMGroup *) acceptInvitationFromGroup: (NSString *)  aGroupId
inviter: (NSString *)  aUsername
error: (EMError **)  pError 
required

Accept group's invitation

Synchronization method will block the current thread

Parameters
groupIdGroup id
aUsernameInviter
pErrorError
Returns
Joined group instance
- (EMError *) acceptJoinApplication: (NSString *)  aGroupId
applicant: (NSString *)  aUsername 
required

Accept user's application, need owner‘s authority

Synchronization method will block the current thread

Parameters
aGroupIdGroup id
aUsernameThe applicant
Returns
Error
- (void) addDelegate: (id< EMGroupManagerDelegate >)  aDelegate
delegateQueue: (dispatch_queue_t)  aQueue 
required

Add delegate

Parameters
aDelegateDelegate
aQueueThe queue of call delegate method
- (EMGroup *) addOccupants: (NSArray *)  aOccupants
toGroup: (NSString *)  aGroupId
welcomeMessage: (NSString *)  aWelcomeMessage
error: (EMError **)  pError 
required

Invite User to join a group

Synchronization method will block the current thread

Parameters
aOccupantsInvited users
aGroupIdGroup id
aWelcomeMessageWelcome message
pErrorError
Returns
Group instance, return nil if fail
- (EMGroup *) applyJoinPublicGroup: (NSString *)  aGroupId
message: (NSString *)  aMessage
error: (EMError **)  pError 
required

Apply to join a public group, group style should be EMGroupStylePublicJoinNeedApproval

Synchronization method will block the current thread

Parameters
aGroupIdPublic group id
aMessageApply info
pErrorError
Returns
Group instance
- (void) asyncAcceptInvitationFromGroup: (NSString *)  aGroupId
inviter: (NSString *)  aUsername
success: (void(^)(EMGroup *aGroup))  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Accept group's invitation

Parameters
groupIdGroup id
aUsernameInviter
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncAcceptJoinApplication: (NSString *)  aGroupId
applicant: (NSString *)  aUsername
success: (void(^)())  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Accept user's application, need owner‘s authority

Parameters
aGroupIdGroup id
aUsernameThe applicant
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncAddOccupants: (NSArray *)  aOccupants
toGroup: (NSString *)  aGroupId
welcomeMessage: (NSString *)  aWelcomeMessage
success: (void(^)(EMGroup *aGroup))  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Invite User to join a group

Parameters
aOccupantsInvited users
aGroupIdGroup id
aWelcomeMessageWelcome message
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncApplyJoinPublicGroup: (NSString *)  aGroupId
message: (NSString *)  aMessage
success: (void(^)(EMGroup *aGroup))  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Apply to join a public group, group style should be EMGroupStylePublicJoinNeedApproval

Parameters
aGroupIdPublic group id
aMessageApply info
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncBlockGroup: (NSString *)  aGroupId
success: (void(^)(EMGroup *aGroup))  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Block group’s message, server will blocks the messages of the group to user, owner can't block the group's message

Parameters
aGroupIdGroup id
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncBlockOccupants: (NSArray *)  aOccupants
fromGroup: (NSString *)  aGroupId
success: (void(^)(EMGroup *aGroup))  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Add users to group’s blacklist, need owner‘s authority

Parameters
aOccupantsUsers to be added
aGroupIdGroup id
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncChangeDescription: (NSString *)  aDescription
forGroup: (NSString *)  aGroupId
success: (void(^)(EMGroup *aGroup))  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Change group’s description, need owner‘s authority

Parameters
aDescriptionNew group‘s description
aGroupIdGroup id
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncChangeGroupSubject: (NSString *)  aSubject
forGroup: (NSString *)  aGroupId
success: (void(^)(EMGroup *aGroup))  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Change group’s subject, need owner‘s authority

Parameters
aSubjectNew group‘s subject
aGroupIdGroup id
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncCreateGroupWithSubject: (NSString *)  aSubject
description: (NSString *)  aDescription
invitees: (NSArray *)  aInvitees
message: (NSString *)  aMessage
setting: (EMGroupOptions *)  aSetting
success: (void(^)(EMGroup *aGroup))  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Create a group

Parameters
aSubjectGroup subject
aDescriptionGroup description
aInviteesGroup members, without creater
aMessageInvitation message
aSettingGroup options
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncDeclineInvitationFromGroup: (NSString *)  aGroupId
inviter: (NSString *)  aUsername
reason: (NSString *)  aReason
success: (void(^)())  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Decline a group invitation

Parameters
aGroupIdGroup id
aUsernameInviter
aReasonDecline reason
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncDeclineJoinApplication: (NSString *)  aGroupId
applicant: (NSString *)  aUsername
reason: (NSString *)  aReason
success: (void(^)())  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Decline user's application, need owner‘s authority

Parameters
aGroupIdGroup id
aUsernameThe applicant
aReasonDecline reason
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncDestroyGroup: (NSString *)  aGroupId
success: (void(^)(EMGroup *aGroup))  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Destroy a group, need owner‘s authority

Parameters
aGroupIdGroup id
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncFetchGroupBansList: (NSString *)  aGroupId
success: (void(^)(NSArray *aList))  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Get group‘s blacklist, need owner’s authority

Parameters
aGroupIdGroup id
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncFetchGroupInfo: (NSString *)  aGroupId
includeMembersList: (BOOL)  aIncludeMembersList
success: (void(^)(EMGroup *aGroup))  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Fetch group info

Parameters
aGroupIdGroup id
aIncludeMembersListWhether get member list
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncGetMyGroupsFromServer: (void(^)(NSArray *aList))  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Get all of user's groups from server, will update group list in memory and DB after success

Parameters
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncGetPublicGroupsFromServerWithCursor: (NSString *)  aCursor
pageSize: (NSInteger)  aPageSize
success: (void(^)(EMCursorResult *aCursor))  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Get public groups in the specified range from the server

Parameters
aCursorCursor, input nil the first time
aPageSizeExpect result count, will return all results if < 0
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncIgnoreGroupPush: (NSString *)  aGroupId
ignore: (BOOL)  aIsIgnore
success: (void(^)())  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Block / unblock group message‘s push notification

Parameters
aGroupIdGroup id
aIgnoreWhether block
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncJoinPublicGroup: (NSString *)  aGroupId
success: (void(^)(EMGroup *aGroup))  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Join a public group, group style should be EMGroupStylePublicOpenJoin

Parameters
aGroupIdPublic group id
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncLeaveGroup: (NSString *)  aGroupId
success: (void(^)(EMGroup *aGroup))  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Leave a group, owner can't leave the group, can only destroy the group

Parameters
aGroupIdGroup id
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncRemoveOccupants: (NSArray *)  aOccupants
fromGroup: (NSString *)  aGroupId
success: (void(^)(EMGroup *aGroup))  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Remove members from group, need owner‘s authority

Parameters
aOccupantsUsers to be removed
aGroupIdGroup id
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncSearchPublicGroupWithId: (NSString *)  aGroundId
success: (void(^)(EMGroup *aGroup))  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Search public group with the id

Parameters
aGroundIdGroup id
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncUnblockGroup: (NSString *)  aGroupId
success: (void(^)(EMGroup *aGroup))  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Unblock group message

Parameters
aGroupIdGroup id
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncUnblockOccupants: (NSArray *)  aOccupants
forGroup: (NSString *)  aGroupId
success: (void(^)(EMGroup *aGroup))  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 
required

Remove users from group‘s blacklist, need owner‘s authority

Parameters
aOccupantsUsers to be removed
aGroupIdGroup id
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (EMGroup *) blockGroup: (NSString *)  aGroupId
error: (EMError **)  pError 
required

Block group’s message, server will blocks the messages of the group to user, owner can't block the group's message

Synchronization method will block the current thread

Parameters
aGroupIdGroup id
pErrorError
Returns
Group instance
- (EMGroup *) blockOccupants: (NSArray *)  aOccupants
fromGroup: (NSString *)  aGroupId
error: (EMError **)  pError 
required

Add users to group’s blacklist, need owner‘s authority

Synchronization method will block the current thread

Parameters
aOccupantsUsers to be added
aGroupIdGroup id
pErrorError
Returns
Group instance
- (EMGroup *) changeDescription: (NSString *)  aDescription
forGroup: (NSString *)  aGroupId
error: (EMError **)  pError 
required

Change group’s description, need owner‘s authority

Synchronization method will block the current thread

Parameters
aDescriptionNew group‘s description
aGroupIdGroup id
pErrorError
Returns
Group
- (EMGroup *) changeGroupSubject: (NSString *)  aSubject
forGroup: (NSString *)  aGroupId
error: (EMError **)  pError 
required

Change group’s subject, need owner‘s authority

Synchronization method will block the current thread

Parameters
aSubjectNew group‘s subject
aGroupIdGroup id
pErrorError
Returns
Group instance
- (EMGroup *) createGroupWithSubject: (NSString *)  aSubject
description: (NSString *)  aDescription
invitees: (NSArray *)  aInvitees
message: (NSString *)  aMessage
setting: (EMGroupOptions *)  aSetting
error: (EMError **)  pError 
required

Create a group

Synchronization method will block the current thread

Parameters
aSubjectGroup subject
aDescriptionGroup description
aInviteesGroup members, without creater
aMessageInvitation message
aSettingGroup options
pErrorError
Returns
Created group
- (EMError *) declineInvitationFromGroup: (NSString *)  aGroupId
inviter: (NSString *)  aUsername
reason: (NSString *)  aReason 
required

Decline a group invitation

Synchronization method will block the current thread

Parameters
aGroupIdGroup id
aUsernameInviter
aReasonDecline reason
Returns
Error
- (EMError *) declineJoinApplication: (NSString *)  aGroupId
applicant: (NSString *)  aUsername
reason: (NSString *)  aReason 
required

Decline user's application, need owner‘s authority

Synchronization method will block the current thread

Parameters
aGroupIdGroup id
aUsernameThe applicant
aReasonDecline reason
Returns
Error
- (EMGroup *) destroyGroup: (NSString *)  aGroupId
error: (EMError **)  pError 
required

Destroy a group, need owner‘s authority

Synchronization method will block the current thread

Parameters
aGroupIdGroup id
pErrorError
Returns
Destroyed group, return nil if fail
- (NSArray *) fetchGroupBansList: (NSString *)  aGroupId
error: (EMError **)  pError 
required

Get group‘s blacklist, need owner’s authority

Synchronization method will block the current thread

Parameters
aGroupIdGroup id
pErrorError
Returns
Group blacklist<NSString>
- (EMGroup *) fetchGroupInfo: (NSString *)  aGroupId
includeMembersList: (BOOL)  aIncludeMembersList
error: (EMError **)  pError 
required

Fetch group info

Synchronization method will block the current thread

Parameters
aGroupIdGroup id
aIncludeMembersListWhether get member list
pErrorError
Returns
Group instance
- (NSArray *) getAllGroups
required

Get all groups, will load from DB if not exist in memory

Returns
Group list<EMGroup>
- (NSArray *) getAllIgnoredGroupIds
required

Get ID list of groups which block push from memory

Returns
Group id list<NSString>
- (NSArray *) getMyGroupsFromServerWithError: (EMError **)  pError
required

Get all of user's groups from server, will update group list in memory and DB after success

Synchronization method will block the current thread

Parameters
pErrorError
Returns
Group list<EMGroup>
- (EMCursorResult *) getPublicGroupsFromServerWithCursor: (NSString *)  aCursor
pageSize: (NSInteger)  aPageSize
error: (EMError **)  pError 
required

Get public groups in the specified range from the server

Synchronization method will block the current thread

Parameters
aCursorCursor, input nil the first time
aPageSizeExpect result count, will return all results if < 0
pErrorError
Returns
The result
- (EMError *) ignoreGroupPush: (NSString *)  aGroupId
ignore: (BOOL)  aIsIgnore 
required

Block / unblock group message‘s push notification

Synchronization method will block the current thread

Parameters
aGroupIdGroup id
aIgnoreWhether block
Returns
Error
- (EMGroup *) joinPublicGroup: (NSString *)  aGroupId
error: (EMError **)  pError 
required

Join a public group, group style should be EMGroupStylePublicOpenJoin

Synchronization method will block the current thread

Parameters
aGroupIdPublic group id
pErrorError
Returns
Joined public group
- (EMGroup *) leaveGroup: (NSString *)  aGroupId
error: (EMError **)  pError 
required

Leave a group, owner can't leave the group, can only destroy the group

Synchronization method will block the current thread

Parameters
aGroupIdGroup id
pErrorError
Returns
Leaved group, return nil if fail
- (NSArray *) loadAllMyGroupsFromDB
required

Load all groups from DB, will update group list in memory after loading

Returns
Group list<EMGroup>
- (void) removeDelegate: (id)  aDelegate
required

Remove delegate

Parameters
aDelegateDelegate
- (EMGroup *) removeOccupants: (NSArray *)  aOccupants
fromGroup: (NSString *)  aGroupId
error: (EMError **)  pError 
required

Remove members from group, need owner‘s authority

Synchronization method will block the current thread

Parameters
aOccupantsUsers to be removed
aGroupIdGroup id
pErrorError
Returns
Group instance
- (EMGroup *) searchPublicGroupWithId: (NSString *)  aGroundId
error: (EMError **)  pError 
required

Search public group with the id

Synchronization method will block the current thread

Parameters
aGroundIdGroup id
pErrorError
Returns
The group with the id
- (EMGroup *) unblockGroup: (NSString *)  aGroupId
error: (EMError **)  pError 
required

Unblock group message

Synchronization method will block the current thread

Parameters
aGroupIdGroup id
pErrorError
Returns
Group instance
- (EMGroup *) unblockOccupants: (NSArray *)  aOccupants
forGroup: (NSString *)  aGroupId
error: (EMError **)  pError 
required

Remove users from group‘s blacklist, need owner‘s authority

Synchronization method will block the current thread

Parameters
aOccupantsUsers to be removed
aGroupIdGroup id
pErrorError
Returns
Group instance

The documentation for this protocol was generated from the following file: