SDKsiOS
Update the group name, description, and avatar
Update a group’s basic display profile with OpenIM iOS SDK.
Invoke setGroupInfo:onSuccess:onFailure: to update basic display attributes such as group name, description, and avatar URL. Obtain the latest OIMGroupInfo instance before modifying target properties to avoid unintentionally overwriting uninitialized verification or permission settings:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupInfo | OIMGroupInfo * | Yes | Group model containing the target groupID and modified fields. |
Code example
OIMGroupInfo *group = latestGroup;
group.groupName = groupName;
group.introduction = introduction;
group.faceURL = avatarURL;
[[OIMManager manager] setGroupInfo:group
onSuccess:^(NSString * _Nullable data) {
NSLog(@"setGroupInfo success");
}
onFailure:^(NSInteger code, NSString *message) {
NSLog(@"setGroupInfo failed: %ld %@", (long)code, message);
}];Return value
The onSuccess callback returns confirmation when the server accepts the group profile update.
State changes after the call
- Local state update: The client updates local cached group attributes corresponding to
groupID. - Event notification: Updated group details broadcast across sessions and devices via the
onGroupInfoChanged:listener callback. - Re-query calibration: For group profile verification, call
getSpecifiedGroupsInfo:onSuccess:onFailure:. For listener setup, refer to Groups overview.
Was this page helpful?