SDKsHarmonyOSEnterprise
Retrieve joined group list with pagination
Paginate through the list of groups that the current account has joined.
Use page-based pagination to load joined groups incrementally when the user belongs to many groups.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
pagination.pageNumber | number | Yes | Page number, starting from 1. |
pagination.showNumber | number | Yes | Number of groups to fetch per page. |
Code example
import sdk, { GetJoinedGroupsPageReq, GetJoinedGroupsPageResp } from '@openimsdk/imsdk';
const request: GetJoinedGroupsPageReq = {
pagination: { pageNumber: 1, showNumber: 50 },
};
const response: GetJoinedGroupsPageResp = await sdk.getJoinedGroupsPage(request);
const groups = response.groups;Return value
Returns a Promise resolving to GetJoinedGroupsPageResp:
| Property | Type | Description |
|---|---|---|
groups | IMGroup[] | List of group profile items for the current page. |
State changes after the call
The response does not include a total count or next-page cursor; when groups.length < showNumber, the end of the list has been reached. If group creation, dismissal, or leave events occur as documented in Group overview, reset pagination and reload from page 1 to prevent inconsistent displays or duplicates.
Was this page helpful?