SDKsuni-app
Search groups
OpenIM uni-app / uni-app x SDK guide for Search groups.
searchGroups() searches only groups joined by the current user and already synchronized locally. The current interface uses the first keyword in keywordList.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
keywordList | string[] | Yes | One trimmed, non-empty keyword. |
isSearchGroupID | boolean | Yes | Whether to match groupID. |
isSearchGroupName | boolean | Yes | Whether to match group name. |
import { searchGroups } from '@/uni_modules/unix-openim-sdk'
const result = await searchGroups({
keywordList: [keyword.trim()],
isSearchGroupID: true,
isSearchGroupName: true,
})
const groups = result?.groups ?? []Return result
groups contains matching OpenIMGroupItem[]. Reject an empty keyword in the UI. Deduplicate results by groupID; they are a snapshot for the current keyword and must not replace the complete joined-group list.
This is not a server-wide group directory. Public discovery, classification, and complex permission filters belong to a trusted application backend.
Was this page helpful?