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

Delete a conversation with messages

Permanently remove a conversation entry and all its locally stored messages for the authenticated user.

Copy

Invoke deleteConversationAndDeleteAllMsg() to permanently delete a conversation record and all messages stored locally for that conversation by the current account. Once executed, the SDK cannot recover these purged messages from local database storage.

Parameters

ParameterTypeRequiredDescription
conversationIDstringYesIdentifier of the target conversation.

Code example

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

await deleteConversationAndDeleteAllMsg(conversationID)

If you only want to remove the conversation list entry while preserving local message records, use Delete a conversation.

Return value

The Promise resolves with void upon successful completion.

State changes after the call

Upon Promise resolution, remove the conversation item and its cached messages from local view models using conversationID as the key. This operation does not remove friend relations, quit groups, or modify data on other users' devices. If necessary, re-query the conversation list as described in Retrieve conversation list to calibrate state.