So we have this code:
public void friendLeaderboard () { Debug.Log ("FRIEND"); PlayFab.ClientModels.GetFriendLeaderboardAroundPlayerRequest request = new PlayFab.ClientModels.GetFriendLeaderboardAroundPlayerRequest (); request.StatisticName = "new_test_stars"; request.IncludeFacebookFriends = true; request.ProfileConstraints.ShowLocations = true; PlayFabClientAPI.GetFriendLeaderboardAroundPlayer (request, friends_success , friend_error ); }
and also:
void friends_success (PlayFab.ClientModels.GetFriendLeaderboardAroundPlayerResult res) { Debug.Log ("FRIENDS"); var x = res.Leaderboard; Debug.Log (x.Count); Debug.Log (x[0].DisplayName) }
but the size of res.Leaderboard is 1
and Debug.Log (x[0].DisplayName)
is my own name.
How do I get my friends names?
Everyone is logged in using :
List<string> permissions = new List<string> (); permissions.Add ("user_friends"); // We invoke basic login procedure and pass in the callback to process the result FB.LogInWithReadPermissions (permissions, OnFacebookLoggedIn);