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

Get joined groups with pagination

Query groups joined by the authenticated user with pagination support.

Copy

Invoke getJoinedGroupListPage() to query joined groups with pagination, ideal for contact books or group selector views with large group memberships.

Parameters

ParameterTypeRequiredDescription
offsetnumberYesPagination starting offset; pass 0 for the first page.
countnumberYesNumber of groups to fetch in this page.

Code example

import { getJoinedGroupListPage } from '@/uni_modules/unix-openim-sdk'

const result = await getJoinedGroupListPage({
  offset: 0,
  count: 50,
})
const groups = result != null ? result.groups : []

Return value

The Promise resolves with an OpenIMGroupListResult | null object. When non-null, groups contains OpenIMGroupItem[] objects for the requested page. Deduplicate and merge records into your view models using groupID. This response does not return total count or cursor tokens; when the returned array contains fewer elements than count, you have reached the end of the list.

When loading subsequent pages, increment offset by the fixed count of queried records rather than the active UI list length. For group structure fields, see Group overview.

State changes after the call

This is a read-only query that establishes a local snapshot. If group join or quit events arrive during active paging, reset the pagination offset and reload from the beginning as described in Group overview.