跳到主要内容

版本:5.X

删除会话

删除指定会话

调用 removeConversation 方法,删除指定会话。

接口

JavaScript
RongIMLib.removeConversation(conversation)

参数说明

参数类型必填说明
conversationIConversationOption目标会话

示例代码

JavaScript
const conversation = {
conversationType: RongIMLib.ConversationType.PRIVATE,
targetId: '接收方的 userId',
}

RongIMLib.removeConversation(conversation).then(res => {
// 删除指定会话成功
if(res.code === 0){
console.log(res.code)
} else {
console.log(res.code, res.msg)
}
})