Browse SDKs · Flutter
Platform
SDKsFlutterEnterprise

Set message destruct

Enable, disable, and configure server-side scheduled message destruction using the OpenIM Flutter SDK.

Copy

Enable or disable scheduled automatic message destruction on the server and configure the retention duration. This feature governs server-side message retention lifecycles and operates independently from client-side read-burn capabilities:

Parameters

ParameterTypeRequiredDescription
conversationIDStringYesTarget conversation ID.
reqConversationReqYesConversation modification request object. Set isMsgDestruct to toggle scheduled destruction, and msgDestructTime to define the retention duration in seconds (for example, 3600 for 1 hour).

Code example

await OpenIM.iMManager.conversationManager.setConversation(
  conversationID,
  ConversationReq(
    isMsgDestruct: true,
    msgDestructTime: 3600,
  ),
);

Return value

A successful Future indicates that the scheduled destruction policy has been configured on the server. To disable this feature, set isMsgDestruct to false.

State changes after the call

Multi-device synchronization and arriving changes trigger conversation change events. The client uses conversationID as the merge key to update destruction settings on the local conversation model. For complete listener integration, see Retrieve conversation list.