Browse SDKs · iOS
Platform
SDKsiOS

Set access to member profiles

Control whether group members can view other members’ profiles with OpenIM iOS SDK.

Copy

Invoke setGroupInfoDictionary:onSuccess:onFailure: to configure whether regular group members can inspect profiles of other members in the group:

Parameters

ParameterTypeRequiredDescription
groupInfoDictionaryNSDictionary *YesDictionary containing the target groupID and profile access permissions.

Access permission options

Enumeration valueNumeric valueDescription
OIMAllowTypeAllowed0Members can view profiles of other group members.
OIMAllowTypeNotAllowed1Regular members cannot view profiles of other group members.

Code example

NSDictionary *changes = @{
    @"groupID": groupID,
    @"lookMemberInfo": @(OIMAllowTypeNotAllowed)
};

[[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 profile access configuration.

State changes after the call

  1. Local state update: The client updates the local cached group's lookMemberInfo property matching groupID.
  2. Event notification: Group members receive an updated OIMGroupInfo object through the onGroupInfoChanged: listener callback.
  3. Re-query calibration: This setting is independent from friend addition permissions. To restrict adding friends within the group, refer to Set permission to add friends from a group. For listener setup, refer to Groups overview.