SDKsHarmonyOSEnterprise
Reject group application
Decline a pending group join request from a specific user.
Decline an incoming group join request with an explanation note:
Code example
import sdk, { ApprovalStatus, HandleGroupApplicationReq } from '@openimsdk/imsdk';
const request: HandleGroupApplicationReq = {
groupID: application.groupID,
fromUserID: application.userID,
handledMsg: 'Application declined',
status: ApprovalStatus.Rejected,
};
await sdk.handleGroupApplication(request);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | string | Yes | Target group identifier. |
fromUserID | string | Yes | Applicant user ID. |
handledMsg | string | No | Rejection explanation note. |
status | ApprovalStatus | Yes | Use ApprovalStatus.Rejected (-1) to decline the request. |
Return value
Returns a Promise that resolves to void when the rejection is submitted.
State changes after the call
Resolving the Promise completes the rejection on the server. When EventOnGroupApplicationRejected arrives, update the application record identified by groupID:userID, as documented in Retrieve received group applications.
Was this page helpful?