Browse SDKs · Android
Platform
SDKsAndroid

Update a group nickname

Use SetGroupMemberInfo.nickname to update a member’s display name in a group.

Copy

Update a member's display nickname (in-group business card) within a specified group. This display name applies only within the group and does not modify the user's global profile nickname.

Code example

SetGroupMemberInfo update = new SetGroupMemberInfo();
update.setGroupID("group_123");
update.setUserID("user_a");
update.setNickname("Alex");

OpenIMClient.getInstance().groupManager.setGroupMemberInfo(
    update,
    new OnBase<String>() {
        @Override
        public void onSuccess(String data) {
            // Group member nickname updated successfully
        }

        @Override
        public void onError(int code, String error) {
            // Failed to update group member nickname
        }
    }
);

Parameters

ParameterTypeRequiredDescription
groupMemberInfoSetGroupMemberInfoYesMember update object. Must specify groupID, member userID, and the new in-group nickname.
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 confirms that the nickname change was committed on the server.
  2. Asynchronous event delivery: Members in the group receive the onGroupMemberInfoChanged event delivering the updated GroupMembersInfo. The client should merge the updated nickname into the cached member record using groupID:userID as the unique key.
  3. Re-query calibration: If member caches fall out of sync, call Get group member profiles to reload the latest member attributes.

For complete listener registration and lifecycle management, see Group overview.