SDKsReact Native
Set a conversation draft
Save a draft for a conversation.
Use setConversationDraft() to save a conversation draft. Submit the current editor content when the user leaves the chat screen, switches conversations, or is about to log out.
await OpenIMSDK.setConversationDraft({
conversationID,
draftText: editorValue,
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | string | Yes | Conversation ID for the draft. |
draftText | string | Yes | Draft content. Pass an empty string to clear the draft. |
Keep the editor state in the application while the user is typing, then save the latest value before leaving the screen.
Return result
After the call completes, the draft is saved. Changes to draftText and draftTextTime in the conversation list are delivered through OnConversationChanged; see Retrieve the conversation list. Clear the application's editor state when the account changes or the user logs out.
Was this page helpful?