When I get friend list's FriendInfo.FriendPlayFabId it doesn't seem to match the playfab id of the player. I'm confused I don't even see that specific id anywhere in any player. I'm returning the user name which is right but FriendPlayFabId isn't. is FriendPlayFabId the same thing as playfab id?
foreach (FriendInfo friend in AccountController.controller.friends) { PlayfabUserData playfabUserData = new PlayfabUserData(); playfabUserData.playfabId = friend.FriendPlayFabId; playfabUserData.username = friend.Username; GameObject player = Instantiate(playerListItem, playerListContainer.transform); player.GetComponent<PlayerListItem>().UpdatePlayerInfo(playfabUserData); playerList.Add(player); }
/// when I run this, it tells me there's no player with that id
public void CHALLENGE_FRIEND(string playfabID) { print("Challenging friend with playfab id " + playfabID); var data = new Dictionary<string, object>() { {"FriendChallenged", playfabEntityId}, }; var dataList = new List<SetObject>() { new SetObject() { ObjectName = "FriendData", DataObject = data }, }; PlayFabDataAPI.SetObjects(new SetObjectsRequest() { Entity = new EntityKey { Id = playfabID, Type = playfabEntityType }, // Saved from GetEntityToken, or a specified key created from a titlePlayerId, CharacterId, etc Objects = dataList, }, (setResult) => { Debug.Log("Friend Challenged" + setResult.ToString()); }, DisplayPlayFabError); }
//this is how I'm finding friends
public void GET_FRIENDS() { //reset friend list and find again in case we have a new friend in list friends = null; PlayFabClientAPI.GetFriendsList(new GetFriendsListRequest { IncludeSteamFriends = false, IncludeFacebookFriends = false, XboxToken = null }, result => { friends = result.Friends; }, DisplayPlayFabError); }