> For the complete documentation index, see [llms.txt](https://bayun.gitbook.io/bayuncoresdk-ios/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bayun.gitbook.io/bayuncoresdk-ios/6-groups/6.7-remove-group-member.md).

# 7.8 Remove Group Member

The `removeFromGroup:groupMember:success:failure` method is used to remove a member 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.
* **groupMember :** `GroupMember` to be removed from the group.
* **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`.

{% tabs %}
{% tab title="Objective-C" %}

```objectivec
GroupMember *groupMember = [[GroupMember alloc] initWithCompanyName:@"<companyName>" companyEmployeeId:@"<companyEmployeeId>"];
[[BayunCore sharedInstance] removeFromGroup:groupId groupMember:groupMember success:^{
     NSLog(@"Member is removed successfully");       
 } failure:^(BayunError error) {
     NSLog(@"Error removing the group member");                  
 }];
```

{% endtab %}

{% tab title="Swift" %}

```swift
let groupMember : GroupMember = GroupMember(companyName:"<companyName>", companyEmployeeId: "<companyEmployeeId>")
BayunCore.sharedInstance()?.remove(fromGroup: "<groupId>", groupMember: groupMember, success: {
    NSLog("Member is removed successfully")                
}, failure: { (bayunErrorCode) in
    NSLog("Error removing the group member")          
})
```

{% endtab %}
{% endtabs %}
