Dear Guys,
does anyone know how to get Statistics from a Friend via https://api.playfab.com/documentation/client/method/GetFriendsList ?
I don´t know how to use the List<StatisticModel> to get the Value from "Highscore" Statistic
Dear Guys,
does anyone know how to get Statistics from a Friend via https://api.playfab.com/documentation/client/method/GetFriendsList ?
I don´t know how to use the List<StatisticModel> to get the Value from "Highscore" Statistic
You can add ProfileConstraints flags in your GetFriendsListRequest so that when you call GetFriendList API, you will be able to retrieve friends’ profiles data.
Here is an example:
PlayFabClientAPI.GetFriendsList( new GetFriendsListRequest { ProfileConstraints = new PlayerProfileViewConstraints { ShowStatistics = true } }, onSuccess => { // this will retrieve your first friend’s first statistic value print(onSuccess.Friends[0].Profile.Statistics[0].Value); }, onFailure => { });
Tried it by my self, this solution works! if(obj.Friends[i].Profile.Statistics.Count >= 1) { }
Thanks, that works! One more question, how can I check if a Playereven has an entry in Statistics?
2 People are following this question.