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

Search groups

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

Copy

searchGroups() searches only groups joined by the current user and already synchronized locally. The current interface uses the first keyword in keywordList.

Parameters

ParameterTypeRequiredDescription
keywordListstring[]YesOne trimmed, non-empty keyword.
isSearchGroupIDbooleanYesWhether to match groupID.
isSearchGroupNamebooleanYesWhether 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.