Browse SDKs · React Native
SDKsReact NativeEnterprise

Schedule server message deletion

Configure scheduled deletion of messages stored on the server.

Copy

Call setConversation() to configure scheduled server-side message deletion for a conversation.

await OpenIMSDK.setConversation({
  conversationID,
  isMsgDestruct: true,
  msgDestructTime: 3600,
});

Parameters

ParameterTypeRequiredDescription
conversationIDstringYesConversation ID to update.
isMsgDestructbooleanNoWhether scheduled server-side message deletion is enabled.
msgDestructTimenumberNoMessage 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.