tencent cloud

All product documents
Chat
Last updated: 2024-01-31 16:22:04
Unity
Last updated: 2024-01-31 16:22:04

Feature Description

The method for recalling a message is MsgRevoke (Details).
The receiver listens for a message recall notification through SetMsgRevokeCallback (Details).

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 MsgRevokeCallback 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)

The sender calls MsgRevoke (Details) to recall a message.
Sample code:
Message message = new Message(); // Here, the message can be an instance returned by another API, such as the message list API.

TIMResult res = TencentIMSDK.MsgRevoke(conv_id, TIMConvType.kTIMConv_C2C, message, (int code, string desc, string user_data) => {
// Process the callback logic
});

Noticing a message recall (by the receiver)

The receiver receives a message recall notification through SetMsgRevokeCallback (Details).
Sample code:
TencentIMSDK.SetMsgRevokeCallback((List<MsgLocator> msg_locator, string user_data) => {
// Process the recalled message among locally maintained messages
});
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon