Browse SDKs · iOS
Platform
SDKsiOS

Update the group name, description, and avatar

Update a group’s basic display profile with OpenIM iOS SDK.

Copy

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

ParameterTypeRequiredDescription
groupInfoOIMGroupInfo *YesGroup 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

  1. Local state update: The client updates local cached group attributes corresponding to groupID.
  2. Event notification: Updated group details broadcast across sessions and devices via the onGroupInfoChanged: listener callback.
  3. Re-query calibration: For group profile verification, call getSpecifiedGroupsInfo:onSuccess:onFailure:. For listener setup, refer to Groups overview.