Browse SDKs · Android
Platform
SDKsAndroid

Reject a group application

Use the Android SDK to reject a user’s application to join a group.

Copy

Group owners and administrators can reject a user's application to join a group. To reject the request, specify the target group ID, the applicant's user ID, and an optional rejection reason.

Code example

String groupID = "group_123";
String applicantUserID = "user_applicant";
String handleMsg = "The group has reached its maximum member capacity.";

OpenIMClient.getInstance().groupManager.refuseGroupApplication(
    new OnBase<String>() {
        @Override
        public void onSuccess(String data) {
            // Group application rejected successfully
        }

        @Override
        public void onError(int code, String error) {
            // Failed to reject group application
        }
    },
    groupID,
    applicantUserID,
    handleMsg
);

Parameters

ParameterTypeRequiredDescription
baseOnBase<String>YesCallback handler for the asynchronous request.
groupIDStringYesGlobally unique ID of the target group.
applicantUserIDStringYesUser ID of the applicant requesting to join.
handleMsgStringNoOptional rejection reason or explanation. Pass an empty string if not needed.

Return value

Upon success, data in onSuccess returns a confirmation message.

State changes after the call

  1. Callback confirmation: The onSuccess callback indicates that the server has processed the rejection and updated the application record.
  2. Asynchronous event delivery: The SDK triggers the onGroupApplicationRejected event on affected clients, delivering the updated GroupApplicationInfo. The client should merge or update the application record using groupID:userID as the unique key.
  3. Re-query calibration: If application state or counts diverge after network reconnections, call getGroupApplicationListAsRecipient() to reconcile local records with the server.

For complete listener registration and lifecycle management, see Group overview.