7.7 Add Group Members

The addInGroup:groupMembers:success:failure: function is used to add new members to the Group. The members to be added in the group may belong to different companies, provided that the company and the member must already be registered with Bayun. Any existing member of the group can add new members. The developer can enforce stricter access-mechanisms on top if desired (e.g. only group-owner or group-admin is allowed to add new members).

The function takes the following parameters :

  • groupId : GroupId of the group.

  • groupMembers : NSArray of GroupMember.

  • success : Success block to be executed after members are added to the group.

  • failure : Failure block to be executed if members could not be added to the group, returns BayunError.

GroupMember *groupMember = [[GroupMember alloc] initWithCompanyName:@"<companyName>" companyEmployeeId:@"<companyEmployeeId>"];
[[BayunCore sharedInstance] addInGroup:@"<groupId>" groupMembers:@[groupMember] success:^{
  NSLog(@"Group member added successfully.");       
} failure:^(BayunError error) {
   NSLog(@"Error adding the group member");
}];

Last updated