Browse SDKs · React Native
Platform
SDKsReact Native

Delete local message

Delete a single message from the current device local storage using the OpenIM React Native SDK.

Copy

Delete a single message from local device storage for a specified conversation:

await OpenIMSDK.deleteMessageFromLocalStorage({
  conversationID,
  clientMsgID,
});

Parameters

ParameterTypeRequiredDescription
conversationIDstringYesConversation ID containing the message.
clientMsgIDstringYesClient message ID to delete locally.

Return value

A resolved Promise confirms that the target message has been removed from the local database on this device.

This operation alters only local device data; it is not uploaded to the server, does not synchronize to other devices, and does not trigger remote deletion events. Remove the message from the local UI view using clientMsgID within the scope of conversationID. To synchronize message deletion across multiple devices or conversation participants, see Delete saved messages.