Delete a local message
Delete one message only from the current device with the WASM SDK.
To hide or clear one message only on the current device, pass the message's conversationID and clientMsgID. Read both identifiers from the current MessageItem; do not substitute a list position or message text.
await openimsdk.deleteMessageFromLocalStorage({
conversationID,
clientMsgID,
});
removeMessage(conversationID, clientMsgID);When the Promise resolves, the message has been deleted only from the current device. Then remove it from the interface and application state by conversationID:clientMsgID. The server still retains the record, so it may be synchronized again after the local database is rebuilt. This operation neither notifies other devices or conversation members nor revokes the message. To show a revoked state to other participants, use Revoke a message. A failed message or one that has not received a server sequence number can only be deleted locally.
Was this page helpful?