Hi
I use PlayFabClientAPI.GetLeaderboard. but not see Locations. Locations always null. In Client Profile Options checked Locations
Hi
I use PlayFabClientAPI.GetLeaderboard. but not see Locations. Locations always null. In Client Profile Options checked Locations
How to I use this to get other statistics? E.g.
If I fetch a leaderboard ranked on how much Gold each user has, how do I simultaneiously get how much Silver a player on the returned leaderboard list has?
I would have to assume the ProfileConstraints was not set correctly. I signed in using your test user, and queried the user above from that other profile using GetPlayerProfile (since that player has no statistics defined at the moment, and so isn't on any leaderboard) and got this back:
{ "code": 200, "status": "OK", "data": { "PlayerProfile": { "PublisherId": "DDBCD590133F4184", "TitleId": "E249", "PlayerId": "7AEE75AF31B1AC4D", "Locations": [ { "ContinentCode": "EU", "CountryCode": "RU", "Latitude": 55.7386, "Longitude": 37.6068 } ] } } }
So I can confirm that the location data is returned. Can you try checking the ProfileConstraints you used?
No. Locations need in Leaderboard. In description:
"IF NON-NULL, THIS DETERMINES WHICH PROPERTIES OF THE RESULTING PLAYER PROFILES TO RETURN. FOR API CALLS FROM THE CLIENT, ONLY THE ALLOWED CLIENT PROFILE PROPERTIES FOR THE TITLE MAY BE REQUESTED. THESE ALLOWED PROPERTIES ARE CONFIGURED IN THE GAME MANAGER "CLIENT PROFILE OPTIONS" TAB IN THE "SETTINGS" SECTION."
I configured in the game manager "Client profile options", but it's not worked. I added in PlayFabClientAPI.GetLeaderboard
ProfileConstraints = new PlayerProfileViewConstraints() { ShowLocations = true }
and everything worked! :) Thanks, but need change descriptions or fix bug.
I'm having the same issue a new title. I've set the Client Profile to allow access to 'Locations' but I still get a null. How did you change Profile Constraints?
4 People are following this question.