Browse SDKs · Android
Platform
SDKsAndroid

Accept a group application

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

Copy

Group owners and administrators can accept an applicant's request to join a group. To process the request, provide the target group ID, the applicant's user ID, and an optional processing note.

Code example

String groupID = "group_123";
String applicantUserID = "user_applicant";
String handleMsg = "Welcome to the group";

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

        @Override
        public void onError(int code, String error) {
            // Failed to accept 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 note or explanation for accepting the request. 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 approval and updated the application state.
  2. Asynchronous event delivery: The SDK triggers synchronization events across affected clients:
  3. onGroupApplicationAccepted: Delivers the updated GroupApplicationInfo. The client should merge or update the application record using groupID:userID as the unique key.
  4. onGroupMemberAdded: Delivers the new GroupMembersInfo object. The client should add the applicant to the local group member cache using groupID:userID as the unique key.
  5. Re-query calibration: If application state or member list counts diverge after intermittent network conditions, call getJoinedGroupListPage(), getGroupMemberList(), or getGroupApplicationListAsRecipient() to reconcile local state with the server.

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