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

Clear all local messages

Clear all messages stored on the local device for the authenticated account.

Copy

Invoke deleteAllMsgFromLocal() to clear all cached message records across all conversations stored on the local device for the currently authenticated account. This method accepts no parameters.

Code example

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

await deleteAllMsgFromLocal()
resetAllMessageState()

Return value

The Promise resolves with void upon successful local deletion.

State changes after the call

This is an irreversible, account-level local database operation. After the Promise resolves, empty all in-memory message lists, search indexes, pagination cursors, and unread counters across all conversations (conversationID).

This call does not notify other devices, affect other chat members, or trigger message deletion events. Because server copies may remain intact, re-logging in or resynchronizing after clearing data may repopulate history. To wipe messages for a single specific conversation only, use Clear conversation messages instead.