SDKsHarmonyOSEnterprise
Check users in group
Verify which users from a given list are currently members of a specified group.
Use this method when you only need to verify group membership status without fetching full member profiles.
Code example
import sdk, { GetUsersInGroupReq, GetUsersInGroupResp } from '@openimsdk/imsdk';
const request: GetUsersInGroupReq = {
groupID: groupID,
userIDs: candidateUserIDs,
};
const response: GetUsersInGroupResp = await sdk.getUsersInGroup(request);
const confirmedUserIDs = response.userIDs;Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | string | Yes | Target group identifier. |
userIDs | string[] | Yes | Array of user IDs to check. |
Return value
Returns a Promise resolving to GetUsersInGroupResp:
| Property | Type | Description |
|---|---|---|
userIDs | string[] | Array containing only user IDs from the input list who currently belong to the group. |
State changes after the call
The returned array contains only user IDs from the input list who are currently members of the group, omitting full profile details. This query reflects an instantaneous snapshot. To maintain an active member roster with real-time updates, see Retrieve group member list.
Was this page helpful?