SDKsAndroid
Update a group nickname
Use SetGroupMemberInfo.nickname to update a member’s display name in a group.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
groupMemberInfo | SetGroupMemberInfo | Yes | Member update object. Must specify groupID, member userID, and the new in-group nickname. |
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 confirms that the nickname change was committed on the server. - Asynchronous event delivery: Members in the group receive the
onGroupMemberInfoChangedevent delivering the updatedGroupMembersInfo. The client should merge the updated nickname into the cached member record usinggroupID:userIDas the unique key. - 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.
Was this page helpful?