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 Description
conversationID string yes The ID of conversation needs to be provided with draft text.
draftText string no The draft text of the conversation. Null for this field means cancelling the current draft text.

Returned template

V2TimCallback

{
    code : number
    desc : string
}

Return value details

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

Code example

import { TencentImSDKPlugin } from 'react-native-tim-js';


const setConversationDraftRes = await TencentImSDKPlugin.v2TIMManager
    .getConversationManager()
    .setConversationDraft(
        '',
        ''
    );
if (setConversationDraftRes.code === 0) {

}

results matching ""

    No results matching ""