Browse SDKs · uni-app / uni-app x
Platform
SDKsuni-app / uni-app x

Set group join verification

Configure approval policies for user join requests and member invitations.

Copy

The needVerification property configures the group's admission policy using OpenIMGroupVerificationType.

Parameters

ParameterTypeRequiredDescription
groupIDstringYesTarget group identifier.
needVerificationOpenIMGroupVerificationTypeYesThe admission verification policy constant.
Enum constantNumeric valueDescription
OpenIMGroupVerificationTypeApplyNeedInviteNot0Join requests require admin review; member invitations add contacts immediately.
OpenIMGroupVerificationTypeAllNeed1Both join requests and invitations by regular members require approval; owner and admin invitations join directly.
OpenIMGroupVerificationTypeAllNot2Anyone can join or be invited without approval.

Code example

import {
  OpenIMGroupVerificationTypeAllNeed,
  setGroupInfo,
} from '@/uni_modules/unix-openim-sdk'

await setGroupInfo({
  groupID,
  needVerification: OpenIMGroupVerificationTypeAllNeed,
})

Return value

The Promise resolves with void once OpenIMServer updates the verification mode.

State changes after the call

A resolved Promise confirms that the verification setting was saved. Update the local group's needVerification field optimistically, and confirm final state when onGroupInfoChanged arrives matching groupID. For complete group event listener registration, see Group overview.