Browse SDKs · HarmonyOS
Platform
SDKsHarmonyOSEnterprise

Enable or disable burn-after-reading

Toggle private burn-after-reading mode for a specific conversation.

Copy

Enable or disable burn-after-reading private mode for a conversation. This operates independently of Set periodic server message destruction:

Code example

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

const request: SetConversationReq = {
  conversationID: conversationID,
  isPrivateChat: true,
};
await sdk.setConversation(request);

Parameters

ParameterTypeRequiredDescription
conversationIDstringYesTarget conversation identifier.
isPrivateChatbooleanYesSet to true to enable burn-after-reading; set to false to disable.

Return value

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

State changes after the call

Pass true to enable burn-after-reading and false to disable it. To set the lifespan of read messages, configure Set burn duration. After the Promise resolves, the SDK emits EventOnConversationChanged. Match the item by conversationID and update its isPrivateChat property in UI state, as described in Retrieve conversation list.