setConversationDraft

Introduction

Set the draft text for the conversation.

Users may switch to other pages when they are editing a new uncompleted message. You can saving the uncompleted message text for showing in the next time back to this conversation by setConversationDraft method, to edit continually.

Draft only supports text in String.

Draft text stored in local, and can not sync to server and other devices.

Parameter details

Parameter name Parameter type Required Platform Description
conversationID String yes All The ID of conversation needs to be provided with draft text.
draftText String no All The draft text of the conversation. Null for this field means cancelling the current draft text.

Returned template

V2TimCallback

{
    code : int
    desc : String
}

Return value details

name type description
code int Request result: Error codes. 0 means success.
desc String The description of the error. It will be empty if success.

Code example

    V2TimCallback setConversationDraftRes = await TencentImSDKPlugin.v2TIMManager
        .getConversationManager()
        .setConversationDraft(
          conversationID: "",
          draftText: "",
        );
    if (setConversationDraftRes.code == 0) {
    }

results matching ""

    No results matching ""