이 페이지는 현재 영어로만 제공되며 한국어 버전은 곧 제공될 예정입니다. 기다려 주셔서 감사드립니다.

메시지 철회

Feature Description

The method for recalling a message is in the core class TencentImSDKPlugin.v2TIMManager.getMessageManager().
The receiver listens for a message recall notification through addAdvancedMsgListener.

Recalling a 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.

Recalling a message (by the sender)

Call revokeMessage (Details) to recall a message.
Below is the sample code:
const revokeMessage = await TencentImSDKPlugin.v2TIMManager
.getMessageManager()
.revokeMessage("msgID");

Noticing a message recall (by the receiver)

1. Call addAdvancedMsgListener (Details) to set the advanced message listener.
2. Receive a message recall notification through onRecvMessageRevoked (Details).
Below is the sample code:
onRecvMessageRevoked: (messageid) => {
// Process the recalled message among locally maintained messages
};