Browse SDKs · HarmonyOS
Platform
SDKsHarmonyOSEnterprise

Set conversation remark

Set a private user remark on a specific conversation record.

Copy

Assign a private remark note to a conversation for the signed-in user. This does not change the friend remark, contact nickname, or group title:

Code example

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

const request: SetConversationReq = {
  conversationID: conversationID,
  remark: 'Project Planning',
};
await sdk.setConversation(request);

Parameters

ParameterTypeRequiredDescription
conversationIDstringYesTarget conversation identifier.
remarkstringYesCustom remark string. Pass an empty string to clear the remark.

Return value

Returns a Promise that resolves to void when the remark is saved.

State changes after the call

Pass an empty string to clear the remark. After the Promise resolves, the SDK emits EventOnConversationChanged. Match the item by conversationID and update its remark attribute in local storage, as shown in Retrieve conversation list.