revokeMessage
Introduction
Recall a sent message.
The sender can recall a successfully sent message.
By default, the sender can recall a message sent within two minutes. You can change the time limit for message recall as instructed in Feature Configuration.
Message recall can be implemented through the receiver UI code: When a message is recalled, the receiver will receive the onRecvMessageRevoked
notification which contains the msgID
of the recalled message. You can identify the recalled message at the UI layer based on the msgID
and change the bubble for the message to the "Message recalled" status.
Only supports to recall the normal message in c2c and group chats, that the message with the onlineUserOnly
is true
can not be recalled.
Do not works for the message in AVChatRoom.
webMessageInstatnce
field is necessary on Web.
Parameter details
Parameter name | Parameter type | Required | Platform | Description |
---|---|---|---|---|
msgID | String | yes | All | The msgID of the message to recall. |
webMessageInstatnce | Object | no | All | The web message instance of the message to recall. |
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 revokeMessageRes =
await TencentImSDKPlugin.v2TIMManager.getMessageManager().revokeMessage(
msgID: "msgID",
webMessageInstatnce: "webMessageInstatnce",
);
if (revokeMessageRes.code == 0) {
}