SDKsiOS
Set access to member profiles
Control whether group members can view other members’ profiles with OpenIM iOS SDK.
Invoke setGroupInfoDictionary:onSuccess:onFailure: to configure whether regular group members can inspect profiles of other members in the group:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupInfoDictionary | NSDictionary * | Yes | Dictionary containing the target groupID and profile access permissions. |
Access permission options
| Enumeration value | Numeric value | Description |
|---|---|---|
OIMAllowTypeAllowed | 0 | Members can view profiles of other group members. |
OIMAllowTypeNotAllowed | 1 | Regular 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
- Local state update: The client updates the local cached group's
lookMemberInfoproperty matchinggroupID. - Event notification: Group members receive an updated
OIMGroupInfoobject through theonGroupInfoChanged:listener callback. - 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.
Was this page helpful?