Browse SDKs · React Native
SDKsReact Native

Clear messages in a conversation

Clear the current account's messages in a conversation without deleting the conversation.

Copy

Call clearConversationAndDeleteAllMsg() to clear the current account's messages in a conversation without deleting the conversation.

await OpenIMSDK.clearConversationAndDeleteAllMsg(conversationID);

Parameters

conversationID is the ID of the conversation whose messages should be cleared.

Return result

After the call completes, clear the message list shown on the current screen. If the latest message, summary, or unread state changes, read the updated conversation from OnConversationChanged or query the conversation list again. See Retrieve the conversation list for listener cleanup.