SDKsuni-app
Search group members
OpenIM uni-app / uni-app x SDK guide for Search group members.
searchGroupMembers() searches members within one group, for example to build an @ mention picker. The current interface uses only the first keyword.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | string | Yes | Target group ID. |
keywordList | string[] | Yes | Search keywords; pass one trimmed non-empty keyword. |
isSearchUserID | boolean | Yes | Whether to match user ID. |
isSearchMemberNickname | boolean | Yes | Whether 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.
Was this page helpful?