Browse SDKs · uni-app / uni-app x
SDKsuni-app

Delete a conversation and its messages

OpenIM uni-app / uni-app x SDK guide for Delete a conversation and its messages.

Copy

deleteConversationAndDeleteAllMsg() removes a conversation entry and all of its messages according to Core/server policy.

import { deleteConversationAndDeleteAllMsg } from '@/uni_modules/unix-openim-sdk'

await deleteConversationAndDeleteAllMsg(conversationID)

This operation is difficult to recover. Ask for confirmation, stop pagination and writes for the conversation, and do not confuse it with hiding a conversation or clearing messages while keeping the entry.

Promise success means that the deletion request completed. Clear the corresponding message store and rebuild the conversation list. If another device or a later event creates state again, reconcile by conversationID rather than retaining a tombstone based only on the old array index.