The getMyGroups method returns all the groups, both public and private, current employee is member of.
Method parameters :
success: Success block to be executed after employee groups are successfully retrieved.
failure: Failure block to be executed if employee groups could not be retrieved, returns BayunError.
ArrayList<Group> myGroupsArray;
// Callbacks to get User's joined Groups
Handler.Callback success = new Handler.Callback() {
@Override
public boolean handleMessage(Message message) {
Log.d(TAG, "Get my groups call successful.");
myGroupsArray = (ArrayList<Group>)message.getData().getSerializable("BayunMyGroupsArray");
for (Group group: myGroupsArray) {
Log.d(TAG, "id: " + group.groupId);
Log.d(TAG, "name: " + group.groupName);
Log.d(TAG, "type: " + group.groupType);
}
return false;
}
};
Handler.Callback failure = new Handler.Callback() {
@Override
public boolean handleMessage(Message message) {
String error = message.getData().getString("BayunError", "");
Log.d(TAG, "Error getting my groups.");
return false;
}
};
bayunCore.getMyGroups(success, failure);
var myGroupsArray: ArrayList<Group>
// Callbacks to get User's joined Groups
val success = Handler.Callback {
Log.d(TAG, "Get my groups call successful.")
myGroupsArray = it.data.getSerializable("BayunMyGroupsArray") as ArrayList<Group>
for (group in myGroupsArray) {
Log.d(TAG, "id: " + group.groupId)
Log.d(TAG, "name: " + group.groupName)
Log.d(TAG, "type: " + group.groupType)
}
false
}
val failure = Handler.Callback {
val error = it.data.getString("BayunError", "")
Log.d(TAG, "Error getting my groups.")
false
}
bayunCore.getMyGroups(success, failure)