Skip to main content

Search Conversations (Electron)

This document is only applicable to the Electron Solution and is limited to use with the Electron modules (@rongcloud/electron and @rongcloud/electron-renderer).

This document describes how to search conversations locally from the client.

Search Local Conversations

tip

This interface is supported starting from SDK version 5.4.0.

Call electronExtension.searchConversationByContent to search the local conversation list based on message content.

const keyword = '<keyword>'
const messageTypes = [RongIMLib.MessageType.TEXT]
RongIMLib.electronExtension.searchConversationByContent(keyword, messageTypes).then(res => {
if (res.code === 0) {
console.log(res.code, res.data)
} else {
console.log(res.code, res.msg)
}
})
ParameterTypeRequiredDescription
keywordstringYesSearch keyword
messageTypesstring[]YesMessage types
channelIdstringNoChannel ID. If not provided, all channel ID types will be retrieved