7.6 Add Group Member
The addInGroup
method is used to add a new member to the Group. The member to be added in the group may belong to a different company, provided that the company and the member must already be registered with Bayun. Any existing member of the group can add a new member. 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).
Method parameters :
groupId: Group Id of the Group.
groupMember :
GroupMember
with companyName and companyEmployeeIdsuccess: Success block to be executed after member is added to the group.
failure: Failure block to be executed if member could not be added to 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 added in 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 adding the group member.");
return false;
}
};
bayunCore.addInGroup(groupId, groupMember, success, failure);
Last updated
Was this helpful?