Set group join verification
Configure approval policies for joining and inviting members to a group using setGroupInfo().
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 constant | Value | Description |
|---|---|---|
DIRECTLY | 0 | Direct join; anyone who requests to join or is invited enters the group immediately. |
APPLY_NEED_VERIFICATION_INVITE_DIRECTLY | 1 | Direct join requests require administrative approval, whereas member invitations add invitees immediately. |
ALL_NEED_VERIFICATION | 2 | All join paths require administrative approval, including both direct applications and invitations. |
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupInfo | GroupInfo | Yes | Group entity holding the target groupID and the updated needVerification mode. |
base | OnBase<String> | Yes | Callback 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.
Was this page helpful?