Set burn duration
Configure the countdown duration in seconds for burn-after-reading private chat mode.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | string | Yes | Identifier of the target conversation. |
burnDuration | number | Yes | Retention 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.
Was this page helpful?