Browse SDKs · uni-app / uni-app x
SDKsuni-app

Search conversations

OpenIM uni-app / uni-app x SDK guide for Search conversations.

Copy

searchConversation() searches the local conversation database using a string keyword and returns OpenIMConversationListResult or null.

import { searchConversation } from '@/uni_modules/unix-openim-sdk'

const result = await searchConversation('Alice')
renderSearchResults(result?.conversations ?? [])

Trim whitespace first. When the input is empty, show the normal conversation list from application state instead of issuing a search. The result is a snapshot at query time; rerun the search after conversation changes, or merge later event items by conversationID.

The exact matched conversation metadata is determined by Core. Do not promise that this searches every message body. Use message-domain search APIs for message content.