tencent cloud

All product documents
Chat
Last updated: 2024-02-06 17:34:24
Unity
Last updated: 2024-02-06 17:34:24

Feature Description

When sending a message, the user may want to switch to another chat window before finishing the message. The unfinished message can be saved through the ConvSetDraft API, so that the user can get back to it through the conv_draft field of the ConvInfo object and finish it.
Caution:
1. A draft can contain only text.
2. A draft will be stored only in the local database and not on the server. Therefore, it cannot be synced across devices and will not be available after the application is uninstalled and reinstalled.

Setting a Conversation Draft

Call the ConvSetDraft API (Details) to set a conversation draft.
Sample code:
DraftParam draft_param = new DraftParam
{
draft_msg = new Message
{
message_conv_id = "1234",
message_conv_type = TIMConvType.kTIMConv_Group,
message_elem_array = new List<Elem>{new Elem
{
elem_type = TIMElemType.kTIMElem_Text,
text_elem_content = Input.text
}},
}
}
TIMResult res = TencentIMSDK.ConvSetDraft(conv_id, conv_type, draft_param);
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 avaliable.

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