Browse SDKs · HarmonyOS
Platform
SDKsHarmonyOSEnterprise

Set group member nickname

Modify the in-group nickname of a specific member.

Copy

The in-group nickname applies solely within the specified group and does not modify the user's account profile nickname.

Code example

import sdk, { SetGroupMemberInfoReq } from '@openimsdk/imsdk';

const request: SetGroupMemberInfoReq = {
  groupID: groupID,
  userID: targetUserID,
  nickname: 'Project Lead',
};
await sdk.setGroupMemberInfo(request);

Parameters

ParameterTypeRequiredDescription
groupIDstringYesTarget group identifier.
userIDstringYesTarget member user ID.
nicknamestringYesNew in-group nickname.

Return value

Returns a Promise that resolves to void when the nickname update succeeds on the server.

State changes after the call

Whether the current user has permission to modify their own or another member's in-group nickname is validated by OpenIMServer based on group roles and policies. Once the Promise resolves, the SDK fires a group member info changed event; clients update the member record matching groupID:userID. For complete event listeners, see Retrieve group member list.