Browse SDKs · uni-app / uni-app x
Platform
SDKsuni-app / uni-app xEnterprise

Set burn duration

Configure the countdown duration in seconds for burn-after-reading private chat mode.

Copy

Configuring burn duration is a Commercial Edition capability. The burnDuration parameter defines the countdown lifespan of messages in seconds once read within private chat mode.

Parameters

ParameterTypeRequiredDescription
conversationIDstringYesIdentifier of the target conversation.
burnDurationnumberYesRetention countdown duration in seconds (for example, 30).

Code example

import { setConversation } from '@/uni_modules/unix-openim-sdk'

await setConversation({
  conversationID,
  burnDuration: 30,
})

Activating or deactivating burn-after-reading mode requires toggling isPrivateChat separately as documented in Set private chat. Do not confuse burnDuration with periodic server-side message destruction settings.

Return value

The Promise resolves with void upon successful completion.

State changes after the call

Promise resolution indicates that the burn duration was saved locally and dispatched to the server. You can immediately update the local conversation object's burnDuration property. The SDK then emits onConversationChanged, where you can verify the persisted setting using conversationID as the primary key. For the centralized conversation list listener, see Retrieve conversation list.