Browse SDKs · iOS
Platform
SDKsiOS

Set group join verification

Configure verification policies for group applications and invitations with OpenIM iOS SDK.

Copy

Invoke setGroupInfoDictionary:onSuccess:onFailure: to configure join verification requirements for applications and member invitations (typically restricted to group owners and administrators):

Parameters

ParameterTypeRequiredDescription
groupInfoDictionaryNSDictionary *YesDictionary containing the target groupID and the join verification mode.

Verification type options

Enumeration valueNumeric valueDescription
OIMGroupVerificationTypeApplyNeedVerificationInviteDirectly0Join applications require review; member invitations join directly.
OIMGroupVerificationTypeAllNeedVerification1Both join applications and regular member invitations require review (owner/admin invitations bypass review).
OIMGroupVerificationTypeDirectly2Anyone can join directly without requiring approval.

Code example

NSDictionary *changes = @{
    @"groupID": groupID,
    @"needVerification": @(OIMGroupVerificationTypeAllNeedVerification)
};

[[OIMManager manager] setGroupInfoDictionary:changes
    onSuccess:^(NSString * _Nullable data) {
        NSLog(@"setGroupInfoDictionary success");
    }
    onFailure:^(NSInteger code, NSString *message) {
        NSLog(@"setGroupInfoDictionary failed: %ld %@", (long)code, message);
    }];

Return value

The onSuccess callback returns confirmation when the server accepts the updated verification policy.

State changes after the call

  1. Local state update: The client updates the local cached group's needVerification property matching groupID.
  2. Event notification: Group members receive an updated OIMGroupInfo object through the onGroupInfoChanged: listener callback.
  3. Re-query calibration: To calibrate local cache values, call getSpecifiedGroupsInfo:onSuccess:onFailure:. For listener setup, refer to Groups overview.