Search joined groups
Search groups joined by the authenticated user and persisted locally.
Invoke searchGroups() to search through the authenticated user's joined groups cached in the local database by matching group names or group IDs. The SDK utilizes the first non-empty keyword in keywordList; this API does not search across unjoined public groups.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
keywordList | string[] | Yes | An array of search strings. Supply a trimmed, non-empty keyword. |
isSearchGroupID | boolean | Yes | Whether to match against groupID. |
isSearchGroupName | boolean | Yes | Whether to match against group display names. |
Code example
import { searchGroups } from '@/uni_modules/unix-openim-sdk'
const result = await searchGroups({
keywordList: [keyword.trim()],
isSearchGroupID: true,
isSearchGroupName: true,
})
const groups = result != null ? result.groups : []Return value
The Promise resolves with an OpenIMGroupListResult | null object containing an array of matched OpenIMGroupItem elements in groups. Render these matches as an independent search result set keyed by groupID; do not overwrite your full joined group cache.
State changes after the call
This is a local read-only query that does not emit events. To search across public server directories or perform category filtering, execute queries through your application backend services.
Was this page helpful?