logo
In-app Chat
SDK Error Codes
Powered Byspreading
On this page

Set conversation draft


Introduction

A conversation draft refers to a text message that the user is currently editing but has not yet sent. ZIM supports saving conversation drafts locally even after the user exits the conversation, so that the user can continue editing.

Procedures

By calling the setConversationDraft interface and specifying the conversation ID and conversation type, you can save the draft to the conversation.

Note

To clear the conversation draft, pass an empty string for the draft field.

After successfully saving the draft, you can use the conversationChanged callback interface to get the updated conversation information.

Untitled
// Set a draft for a conversation
// Take a group conversation as an example
zim.setConversationDraft("draft", "Group_ID", 2).then(function({ conversationID, conversationType }){
        // Logic after the successful operation
    })
    .catch(function(err){
        // Seek ZEGOCLOUD official error code document for solution
    });
1
Copied!

Previous

Query a conversation

Next

Mark conversations