deleteMessageFromLocalStorage

Introduction

Delete the message from local storage.

This API can only be used to delete a local historical message. After deleted, the message will be marked as deleted locally by the SDK and can no longer be pulled through getHistoryMessageList.

If the application is uninstalled and reinstalled, the delete marker will be lost locally, and the message can still be pulled through getHistoryMessageList.

Do not works on Web.

The lastMessage from V2TimConversation will ba changed to the previous message, if the deleted message is the last message.

Parameter details

Parameter name Parameter type Required Platform Description
msgID String yes All The msgID of the message to be deleted.

Returned template

V2TimCallback

{
    code : int
    desc : String
}

Return value details

name type description
code int Request result: Error codes. 0 means success.
desc String The description of the failure.

Code example

    V2TimCallback deleteMessageFromLocalStorageRes = await TencentImSDKPlugin
        .v2TIMManager
        .getMessageManager()
        .deleteMessageFromLocalStorage(msgID: ""); 
    if (deleteMessageFromLocalStorageRes.code == 0) {
    }

results matching ""

    No results matching ""