SDKsAndroid
Update a group member avatar
Use SetGroupMemberInfo.faceURL to update the avatar displayed for a member in a group.
Update the dedicated avatar displayed for a specific member within a group. This avatar change applies exclusively inside the target group and does not modify the user's global profile avatar.
Code example
SetGroupMemberInfo update = new SetGroupMemberInfo();
update.setGroupID("group_123");
update.setUserID("user_a");
update.setFaceURL("https://example.com/member_avatar.png");
OpenIMClient.getInstance().groupManager.setGroupMemberInfo(
update,
new OnBase<String>() {
@Override
public void onSuccess(String data) {
// Group member avatar updated successfully
}
@Override
public void onError(int code, String error) {
// Failed to update group member avatar
}
}
);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupMemberInfo | SetGroupMemberInfo | Yes | Member update object. Must specify groupID, member userID, and the new avatar URL faceURL. |
base | OnBase<String> | Yes | Callback handler for the asynchronous request. |
Return value
Upon success, data in onSuccess returns a confirmation message.
State changes after the call
- Callback confirmation: The
onSuccesscallback indicates that the member avatar URL has been persisted on the server. - Asynchronous event delivery: Group members receive the
onGroupMemberInfoChangedevent delivering the updatedGroupMembersInfo. The client should update the member avatar in its cache usinggroupID:userIDas the unique key. - Re-query calibration: If avatar caches become inconsistent, call Get group member profiles to reload up-to-date member records.
For complete listener registration and lifecycle management, see Group overview.
Was this page helpful?