Browse SDKs · HarmonyOS
Platform
SDKsHarmonyOSEnterprise

Reject group application

Decline a pending group join request from a specific user.

Copy

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

ParameterTypeRequiredDescription
groupIDstringYesTarget group identifier.
fromUserIDstringYesApplicant user ID.
handledMsgstringNoRejection explanation note.
statusApprovalStatusYesUse 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.