I want to create a close friends system where you need to send a friend request to a player in order to get close friends. It is necessary that player B is already in player A's friends list before player A can send a close friend request to player B in my game's friend list menu. I use PlayFabClientAPI.AddFriend in my game to add a friend.
I found the following CloudScript code example from Rick Chen: https://community.playfab.com/questions/46961/add-friend-using-friend-request-with-acceptdecline.html
I don't want that player A can send multiple close friend requests to player B. It should only be possible for player A and player B to send a new close friends request if player B has accepted or declined the first close friends request. How can I find out if a close friend request already exists?
Answer by Gosen Gao · May 18 at 08:16 AM
If you implement your close friends service with Rick's workflow that player A sends a close friend request to player B, there will be a tag in the friend list, such as “WantToBeCloseFriend”/"WaitToBeAccepted". Then, you can know if a close friend request already exists by checking the tag.