Browse SDKs · Android
Platform
SDKsAndroid

Update a group member avatar

Use SetGroupMemberInfo.faceURL to update the avatar displayed for a member in a group.

Copy

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

ParameterTypeRequiredDescription
groupMemberInfoSetGroupMemberInfoYesMember update object. Must specify groupID, member userID, and the new avatar URL faceURL.
baseOnBase<String>YesCallback handler for the asynchronous request.

Return value

Upon success, data in onSuccess returns a confirmation message.

State changes after the call

  1. Callback confirmation: The onSuccess callback indicates that the member avatar URL has been persisted on the server.
  2. Asynchronous event delivery: Group members receive the onGroupMemberInfoChanged event delivering the updated GroupMembersInfo. The client should update the member avatar in its cache using groupID:userID as the unique key.
  3. 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.