7.10 Remove Group Members Except List

The removeFromGroup:exceptList:removeCallingMember:success:failure method is used to remove all members of the Group except the list of group members. Calling member is not removed from the group. Any existing member of the group can remove other members. The developer can choose to build stricter access-control mechanisms on top of this if desired (e.g. only the group-owner or group-admin is authorized to remove members from the group).

Method parameters :

  • groupId : GroupId of the group.

  • groupMembers : NSArray of GroupMember NOT to be removed from the group. If the group members array is empty, all the members of the group are removed except the calling member.

  • removeCallingMember : Determines whether the calling member should be removed from the group or not.

  • success : Success block to be executed after member is removed from the group.

  • failure : Failure block to be executed if member could not be removed from the group, returns BayunError.

GroupMember *groupMember = [[GroupMember alloc] initWithCompanyName:@"<companyName>" companyEmployeeId:@"<companyEmployeeId>"];
Bool removeCallingMember = false;
[[BayunCore sharedInstance] removeFromGroup:groupId exceptList:@[groupMember] removeCallingMember:removeCallingMember success:^{
     NSLog(@"Members are removed successfully");       
 } failure:^(BayunError error) {
     NSLog(@"Error removing the group members");                  
}];

Last updated