Browse SDKs · Flutter
Platform
SDKsFlutter

Delete conversation with messages

Remove a specified conversation entry and clear all its historical messages using the OpenIM Flutter SDK.

Copy

Delete a specified conversation entry from the conversation list while simultaneously clearing all historical messages for the current account:

Parameters

ParameterTypeRequiredDescription
conversationIDStringYesTarget conversation ID.

Code example

await OpenIM.iMManager.conversationManager
    .deleteConversationAndDeleteAllMsg(conversationID: conversationID);

Return value

A successful Future indicates that the request to delete the conversation and its message history has completed. The client should immediately remove the conversation item and message view from the UI. This operation does not remove friendships or dismiss/leave groups; if a new message arrives subsequently, the conversation is recreated.

State changes after the call

Remove the conversation item from the local conversation list using conversationID as the key. For complete event listening, see Retrieve conversation list. If you only want to clear message history while keeping the conversation entry visible, see Clear conversation messages.