SDKsHarmonyOSEnterprise
Retrieve joined group list
Retrieve all groups that the current account has joined.
When the number of groups is small, retrieve the entire list of joined groups for the current account in a single call.
Code example
import sdk, { GetJoinedGroupsResp } from '@openimsdk/imsdk';
const response: GetJoinedGroupsResp = await sdk.getJoinedGroups();
const groups = response.groups;Parameters
This method does not take any parameters.
Return value
Returns a Promise resolving to GetJoinedGroupsResp:
| Property | Type | Description |
|---|---|---|
groups | IMGroup[] | Complete list of groups joined by the current account. |
State changes after the call
The returned IMGroup[] list represents the current account's joined groups, not a public group directory. When joined groups are numerous, use Retrieve joined group list with pagination instead. This call is a snapshot and does not trigger events; subsequent join, leave, and group profile updates should be maintained via events documented in Group overview.
Was this page helpful?