Browse SDKs · WASM
SDKsWASM

Reject a friend application

Reject a friend application from a selected user.

Copy

When rejecting a received friend application, set toUserID to the applicant's user ID. handleMsg can contain a reason or note; pass an empty string when no message is needed.

await openimsdk.refuseFriendApplication({ toUserID: applicantUserID, handleMsg: '' });

When the Promise resolves, the server has completed the reject request, but the application event may not have arrived yet. When OnFriendApplicationRejected arrives, update the matching record by the two user IDs in the application. Rejecting an application does not create a friendship and is not the same as deleting the application record. For the complete listener, see Get received friend applications.