7.8 Remove Group Member
The removeFromGroup
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 : Group Id of the Group.
groupMember :
GroupMember
with companyName and companyEmployeeId.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
.
import com.bayun_module.GroupMember
String companyEmployeeId = "<companyEmployeeId>";
String companyName = "<companyName>";
String groupId = "<groupId>";
GroupMember groupMember = new GroupMember();
groupMember.companyEmployeeId = companyEmployeeId;
groupMember.companyName = companyName;
//Success Callback
Handler.Callback success = new Handler.Callback() {
@Override
public boolean handleMessage(Message message) {
Log.d(TAG, "Member is removed from the Group successfully.");
return false;
}
}
//Failure Callback
Handler.Callback failure = new Handler.Callback() {
@Override
public boolean handleMessage(Message message) {
String error = message.getData().getString("BayunError", "");
Log.d(TAG, "Error removing the group member.");
return false;
}
};
bayunCore.removeFromGroup(groupId, groupMember, success, failure);
Last updated
Was this helpful?