Browse SDKs · React Native
SDKsReact Native

Accept a friend application

Accept a friend request with the OpenIM React Native SDK.

Copy

Call acceptFriendApplication() to accept a friend request.

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

Parameter description

ParameterTypeRequiredDescription
toUserIDstringYesUser ID of the applicant.
handleMsgstringYesMessage attached when handling the request. Pass an empty string when there is no message.

Accepting the request establishes a friendship and emits friend-request status changes and OnFriendAdded. See Get the friend list for the friend-list listener.