Browse SDKs · WASM
SDKsWASM

Delete a friend

Delete the friendship between the current user and a selected user.

Copy
await openimsdk.deleteFriend(friendUserID);

friendUserID is the user ID of the friend to delete.

A successful Promise means that the friendship deletion request has completed, so the submission state can end. When OnFriendDeleted arrives, remove the record with the matching userID from the friend list and profile card. If the event does not arrive, query the friend list again and use the latest result. See Get the friend list for the complete listener.