SDKsHarmonyOSEnterprise
Set group member nickname
Modify the in-group nickname of a specific member.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | string | Yes | Target group identifier. |
userID | string | Yes | Target member user ID. |
nickname | string | Yes | New 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.
Was this page helpful?