deleteMessages

Introduction

Delete messages from both local and remote server.

This API deletes messages both locally and from the cloud, which cannot be recovered.

Up to 30 messages can be deleted per call.

Messages to be deleted per call must be from the same conversation.

This API can be called only once per second.

If messages have been pulled on a device by an account, they will remain on the device after the API is called to delete them from the cloud; in other words, deleted messages are not synced.

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
msgIDs List< String > yes All The list of msgID of the messages to be deleted.
webMessageInstanceList List< dynamic > no All The list of message instances to be deleted on web.

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 deleteMessagesRes = await TencentImSDKPlugin.v2TIMManager
        .getMessageManager()
        .deleteMessages(msgIDs: ['messageid'], 
            webMessageInstanceList: [] 
            );
    if (deleteMessagesRes.code == 0) {
    }

results matching ""

    No results matching ""