会话草稿
保存草稿
调用 saveTextMessageDraft 方法,保存消息草稿。
接口
JavaScript
RongIMLib.saveTextMessageDraft(conversation, draft)
参数说明
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
conversation | IConversationOption | 是 | 目标会话 |
draft | String | 是 | 草稿内容 |
示例代码
JavaScript
const conversation = {
conversationType: RongIMLib.ConversationType.PRIVATE,
targetId: '接收方的 userId'
}
const draft = '草稿内容'
RongIMLib.saveTextMessageDraft(conversation, draft).then(res => {
// 保存成功
if(res.code === 0){
console.log(res)
} else {
console.log(res.code, res.msg)
}
})