I am using Unity. I have been able to successfully add a friend and display it on a friend list using their playfab display name. However when I remove the friend, the friend remains on the friend list.
I have to close the game and restart it for the friend list to update. Is there a way to have it delete the current friend from the list immediately (would I have to destroy the cloned object).?
I have parts of my code below which are attached to a button.
void DisplayFriends(List<FriendInfo> friendsCache) { foreach (FriendInfo f in friendsCache) { bool isFound = false; if (myFriends != null) foreach (FriendInfo g in myFriends) { if (f.FriendPlayFabId == g.FriendPlayFabId) { isFound = true; Debug.Log("TEST friend removal HERE"); } } if (isFound == false) { GameObject listing = Instantiate(listingPrefab, friendScrollView); PlayerListing templisting = listing.GetComponent<PlayerListing>(); templisting.PlayerNameText.text = f.TitleDisplayName; } } myFriends = friendsCache; } void RemoveFriend(FriendInfo friendInfo) { PlayFabClientAPI.RemoveFriend(new RemoveFriendRequest { FriendPlayFabId = friendInfo.FriendPlayFabId }, result => { _friends.Remove(friendInfo); }, DisplayPlayFabFriendsError); DisplayFriends(_friends); Debug.Log("removing friend part 3"); }