Browse SDKs · React Native
Platform
SDKsReact Native

Delete a friend

Remove a friendship relation with a specified user using the OpenIM React Native SDK.

Copy

Remove an established friendship between the authenticated user and a specified friend:

await OpenIMSDK.deleteFriend(friendUserID);

Parameters

ParameterTypeRequiredDescription
friendUserIDstringYesTarget friend's user ID to delete.

Return value

A resolved Promise confirms that the friendship has been dissolved on the server.

Both users' clients receive the OnFriendDeleted event. Remove the friend entry keyed by userID from your local friend cache. For full event listeners, see Get friend list by page.