Delete conversation with messages
Remove a specified conversation entry and clear all its historical messages using the OpenIM Flutter SDK.
Delete a specified conversation entry from the conversation list while simultaneously clearing all historical messages for the current account:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | String | Yes | Target 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.
Was this page helpful?