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

Search joined groups

Search groups joined by the authenticated user and persisted locally.

Copy

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

ParameterTypeRequiredDescription
keywordListstring[]YesAn array of search strings. Supply a trimmed, non-empty keyword.
isSearchGroupIDbooleanYesWhether to match against groupID.
isSearchGroupNamebooleanYesWhether 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.