6.9 Delete Group

The deleteGroup method is used to delete a group the user is a member of. Any existing member of the group can delete the group. 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 delete the group).

Method parameters :
  • groupId: Group Id of the Group.
  • success: Success block to be executed after group is deleted.
  • failure: Failure block to be executed if group could not be deleted, returns BayunError.

Java
Kotlin
String groupId = "groupId";

// Callbacks to delete a group
success = new Handler.Callback() {
    @Override
    public boolean handleMessage(Message message) {
        Log.d(TAG, "Group deleted successfully.");
        return false;
    }
}

failure = new Handler.Callback() {
    @Override
    public boolean handleMessage(Message message) {
        String error = message.getData().getString("BayunError", "");
        if (error.equalsIgnoreCase(BayunError.ERROR_INTERNET_CONNECTION)) {

        } else if (error.equalsIgnoreCase(BayunError.ERROR_REQUEST_TIMEOUT)) {

        }
        return false; 
    }
};

bayunCore.deleteGroup(groupId, success, failure);
val groupId = "groupId"

// Callbacks to delete a group
val success = Handler.Callback {
    Log.d(TAG, "Group deleted successfully.")
    false
}

val failure = Handler.Callback {
    val error = it.data.getString("BayunError", "")
    if (error == BayunError.ERROR_INTERNET_CONNECTION) {

    } else if (error == BayunError.ERROR_REQUEST_TIMEOUT) {

    }
    false
}

bayunCore.deleteGroup(groupId, success, failure)

results matching ""

    No results matching ""