Schedule server message deletion
Configure scheduled deletion of messages stored on the server.
Call setConversation() to configure scheduled server-side message deletion for a conversation.
await OpenIMSDK.setConversation({
conversationID,
isMsgDestruct: true,
msgDestructTime: 3600,
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | string | Yes | Conversation ID to update. |
isMsgDestruct | boolean | No | Whether scheduled server-side message deletion is enabled. |
msgDestructTime | number | No | Message deletion period in seconds. |
Pass isMsgDestruct: true together with msgDestructTime to enable the policy. Pass isMsgDestruct: false to disable it. This policy is different from burn after reading, which uses isPrivateChat and burnDuration.
Scheduled deletion affects messages stored on the server. Messages already synchronized to a device are not actively removed; after local data is cleared or the device changes, messages deleted from the server cannot be retrieved again.
Return result
After the call completes, the scheduled server-side message deletion policy is updated. Changes in the conversation list are delivered through OnConversationChanged; see Retrieve the conversation list.
Was this page helpful?