SDKsHarmonyOSEnterprise
Accept group application
Approve a pending group join request from a specific user.
Group owners or administrators approve pending join requests using handleGroupApplication():
Code example
import sdk, { ApprovalStatus, HandleGroupApplicationReq } from '@openimsdk/imsdk';
const request: HandleGroupApplicationReq = {
groupID: application.groupID,
fromUserID: application.userID,
handledMsg: 'Approved to join',
status: ApprovalStatus.Approved,
};
await sdk.handleGroupApplication(request);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | string | Yes | Target group identifier. |
fromUserID | string | Yes | Applicant user ID. |
handledMsg | string | No | Approval remark note. |
status | ApprovalStatus | Yes | Use ApprovalStatus.Approved (1) to approve the application. |
Return value
Returns a Promise that resolves to void upon server acceptance.
State changes after the call
Resolving the Promise confirms approval on the server. Do not manually fabricate the final member object locally; wait for EventOnGroupApplicationAccepted to update the application item, and rely on group member events for roster changes. For complete event listeners, see Retrieve received group applications.
Was this page helpful?