Group message

5.1 Group event protocol function

Obtain the XHGroupManager instance and add the group event protocol function.

/**
Group member number change

@param groupID group id
@param membersNumber Number of members
*/
- (void)group:(NSString*)groupID didMembersNumberUpdeted:(NSInteger)membersNumber
{
}

/**
You are removed from the current group

@param groupID group id
*/
- (void)groupUserKicked:(NSString*)groupID
{
}

/**
Group deleted notification

@param groupID group id
*/
- (void)groupDidDeleted:(NSString*)groupID
{
}

/**
Receive group message

@param aMessage message
@param fromID message sender
*/
- (void)groupMessagesDidReceive:(NSString *)aMessage fromID:(NSString *)fromID
{
}

5.2 XHGroupManager API Description

/**
Create a group
@param groupName Group name
@param completion callback
*/
- (void)createGroup:(NSString *)groupName completion:(void(^)(NSString *groupID,NSError *error))completion;
/**
Delete the group
@param groupID group ID
@param completion callback
*/
- (void)deleteGroup:(NSString *)groupID completion:(void(^)(NSError *error))completion;

/**
Add group members
@param memberIds the array of Member ID
@param groupID group ID
@param completion callback
*/
- (void)addGroupMembers:(NSArray<NSString*> *)memberIds toGroup:(NSString *)groupID completion:(void(^)(NSError *error))completion;

/**
Delete the group member
@param memberIds the array of Member ID
@param groupID group ID
*/
- (void)deleteGroupMembers:(NSArray<NSString*> *)memberIds fromGroup:(NSString *)groupID completion:(void(^)(NSError *error))completion;

/**
Set DND
@param groupId group member
@param enable YES means DND, NO means undoing DND
@param completion 回调
*/
- (void)setGroup:(NSString *)groupId pushEnable:(BOOL)enable completion:(void(^)(NSError *error))completion;

/**
Send a message
@param message message cotent
@param groupID group ID
@param atUsers @user
@param completion callback
*/
- (void)sendMessage:(NSString *)message toGroup:(NSString *)groupID atUsers:(NSArray<NSString*> *)atUsers completion:(void(^)(NSError *error))completion;