Browse SDKs · HarmonyOS
Platform
SDKsHarmonyOSEnterprise

Accept group application

Approve a pending group join request from a specific user.

Copy

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

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