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.
Parameter details
Parameter name | Parameter type | Required | Description |
---|---|---|---|
msgID | string | yes | The msgID of the message to recall. |
Returned template
V2TimCallback
{
code : number
desc : string
}
Return value details
name | type | description |
---|---|---|
code | number | Request result: Error codes. 0 means success. |
desc | string | The description of the error. It will be empty if success. |
Code example
import { TencentImSDKPlugin } from 'react-native-tim-js';
const revokeMessageRes = await TencentImSDKPlugin.v2TIMManager
.getMessageManager()
.revokeMessage(
'msgID'
);
if (revokeMessageRes.code === 0) {
}