Browse SDKs · React Native
Platform
SDKsReact Native

Clear all messages

Clear all message records both locally and on the server for the current account using the OpenIM React Native SDK.

Copy

Clear all message records for the current account across both local storage and the remote server:

await OpenIMSDK.deleteAllMsgFromLocalAndSvr();

Return value

A resolved Promise confirms that all message records belonging to the current account have been purged from both local databases and server-side history. Messages already delivered to and stored by counterparties remain unaffected.

This is an irreversible, account-level operation; require explicit secondary confirmation from the user prior to execution. Once cleared, message histories are synchronized across all devices where this account is logged in. Reset all local conversation message caches and UI lists upon completion.