SDKsHarmonyOSEnterprise
Search joined groups
Search through groups that the current account has joined and synced locally.
This method searches groups that the current account has already joined and synchronized locally; it does not discover public groups.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
keyword | string | Yes | Non-empty keyword trimmed of whitespace. |
searchGroupID | boolean | Yes | Whether to match against groupID. |
searchGroupName | boolean | Yes | Whether to match against the group name. |
Code example
import sdk, { SearchGroupsReq, SearchGroupsResp } from '@openimsdk/imsdk';
const request: SearchGroupsReq = {
keyword: keyword.trim(),
searchGroupID: true,
searchGroupName: true,
};
const response: SearchGroupsResp = await sdk.searchGroups(request);
const groups = response.groups;Return value
Returns a Promise resolving to SearchGroupsResp:
| Property | Type | Description |
|---|---|---|
groups | IMGroup[] | Array of matching joined groups. |
State changes after the call
Display search results as a separate result set rather than overwriting the complete joined group list retrieved via Retrieve joined group list with pagination. Public group directories, category filtering, and complex permission checks should be provided by your backend service.
Was this page helpful?