Browse SDKs · React Native
Platform
SDKsReact Native

Refuse a friend request

Decline an incoming friend application from a specified applicant with the OpenIM React Native SDK.

Copy

Decline an incoming friend request from a specified applicant:

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

Parameters

ParameterTypeRequiredDescription
toUserIDstringYesUser ID of the applicant who initiated the request.
handleMsgstringYesRejection reason message. Pass empty string "" if not needed.

Return value

A resolved Promise confirms that the refusal was recorded on the server.

Refusing a request emits the OnFriendApplicationRejected event on both users' clients. Update the status of the application entry in the friend request list. For event listener setup, see Get received friend applications.