SDKsiOS
Update a group member’s avatar
Update a specified member’s avatar within a group with OpenIM iOS SDK.
Invoke setGroupMemberInfo:onSuccess:onFailure: with a parameter dictionary containing faceURL to configure a group-specific avatar for a member:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupMemberInfoDictionary | NSDictionary * | Yes | Dictionary containing member identification and updated avatar URL. |
Dictionary keys
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | NSString * | Yes | Target group ID. |
userID | NSString * | Yes | Target member user ID. |
faceURL | NSString * | Yes | New avatar URL for the member in this group. |
Code example
NSDictionary *updates = @{
@"groupID": @"group_1001",
@"userID": @"user_003",
@"faceURL": @"https://example.com/avatar/group_user_003.png"
};
[[OIMManager manager] setGroupMemberInfo:updates
onSuccess:^(NSString * _Nullable data) {
NSLog(@"setGroupMemberInfo avatar success");
}
onFailure:^(NSInteger code, NSString *message) {
NSLog(@"setGroupMemberInfo avatar failed: %ld %@", (long)code, message);
}];Return value
The onSuccess callback returns confirmation when the server accepts the avatar update.
State changes after the call
- Local state update: The client updates the member's avatar attribute matching
groupID:userID. This avatar is scoped strictly to the current group and does not change the user's global profile avatar. - Event notification: Updated member details broadcast across active client sessions through
onGroupMemberInfoChanged:. - Re-query calibration: For member queries, refer to Group member queries overview.
Was this page helpful?