Clear conversation messages
Clear all message history in a specified conversation while retaining the conversation entry using the OpenIM React Native SDK.
Clear all message history records in a specified conversation. This operation removes stored messages while keeping the conversation entry and its settings intact:
await OpenIMSDK.clearConversationAndDeleteAllMsg(conversationID);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | string | Yes | Target conversation ID whose message history should be cleared. |
Return value
A resolved Promise confirms that the request to clear messages was processed by the server.
Promise resolution indicates that historical messages have been purged. When the conversation's latest message, unread counter, or preview state changes as a result, the SDK triggers the OnConversationChanged event. Reconcile changes by matching conversationID and wipe the corresponding local message list view. For full listener registration, see Retrieve conversation list.
Was this page helpful?