Browse SDKs · Android
Platform
SDKsAndroid

Set group join verification

Configure approval policies for joining and inviting members to a group using setGroupInfo().

Copy

Configure the join verification policy for a group. Group owners and administrators can set the needVerification property on GroupInfo to govern whether direct join requests or member invitations require administrative review.

Code example

GroupInfo update = new GroupInfo();
update.setGroupID("group_123");
update.setNeedVerification(GroupVerification.ALL_NEED_VERIFICATION);

OpenIMClient.getInstance().groupManager.setGroupInfo(
    update,
    new OnBase<String>() {
        @Override
        public void onSuccess(String data) {
            // Join verification updated successfully
        }

        @Override
        public void onError(int code, String error) {
            // Handle update failure
        }
    }
);

Verification modes

Use the constants defined in GroupVerification:

Enum constantValueDescription
DIRECTLY0Direct join; anyone who requests to join or is invited enters the group immediately.
APPLY_NEED_VERIFICATION_INVITE_DIRECTLY1Direct join requests require administrative approval, whereas member invitations add invitees immediately.
ALL_NEED_VERIFICATION2All join paths require administrative approval, including both direct applications and invitations.

Parameters

ParameterTypeRequiredDescription
groupInfoGroupInfoYesGroup entity holding the target groupID and the updated needVerification mode.
baseOnBase<String>YesCallback delivering the asynchronous operation result.

Return value

The successful callback confirms that the verification rule was updated on the server.

State changes after the call

A successful callback confirms that the server persisted the new join verification policy. The rule applies strictly to requests submitted after the update; it does not auto-resolve or discard existing pending applications. Group members receive the onGroupInfoChanged(GroupInfo group) event via OnGroupListener. Merge the updated policy into your local cache using groupID. For complete listener registration details, see Group overview.