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

Search group members

OpenIM uni-app / uni-app x SDK guide for Search group members.

Copy

searchGroupMembers() searches members within one group, for example to build an @ mention picker. The current interface uses only the first keyword.

Parameters

ParameterTypeRequiredDescription
groupIDstringYesTarget group ID.
keywordListstring[]YesSearch keywords; pass one trimmed non-empty keyword.
isSearchUserIDbooleanYesWhether to match user ID.
isSearchMemberNicknamebooleanYesWhether to match in-group nickname.
import { searchGroupMembers } from '@/uni_modules/unix-openim-sdk'

const result = await searchGroupMembers({
  groupID,
  keywordList: [keyword.trim()],
  isSearchUserID: true,
  isSearchMemberNickname: true,
})
const members = result?.members ?? []

Unlike the Wasm version, this interface has no offset or count; it returns the current matches. Reject an empty keyword and replace the search snapshot when the input changes.

members contains matching OpenIMGroupMemberItem[]. Deduplicate by groupID:userID and do not replace the complete member list. This searches member data, not the global user directory.