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

Clear all messages

Clear all messages stored both locally and on the server for the authenticated account.

Copy

Invoke deleteAllMsgFromLocalAndSvr() to purge all message records both from local device storage and from the server for the authenticated user across all conversations. This method accepts no parameters.

Code example

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

await deleteAllMsgFromLocalAndSvr()
resetAllMessageState()

Return value

The Promise resolves with void upon successful completion.

State changes after the call

This is an irreversible, account-wide operation. When the Promise resolves, clear all cached messages, search indices, pagination cursors, and message summaries across all conversations (conversationID).

This operation does not delete message copies held by other conversation participants, nor does it guarantee that other devices logged into the same account have completed UI updates. Subsequent conversation events will deliver updated conversation summaries keyed by conversationID. Re-query conversation lists if necessary to calibrate state.