Hey,
when i am calling PlayFabClientAPI.GetFriendLeaderboard i am alwase get 0 result.
request:GetFriendLeaderboardRequest getFriendLeaderboardRequest = new GetFriendLeaderboardRequest()
{ MaxResultsCount = 5, StatisticName = $"lEVEL_STATISTICS_NAME", ProfileConstraints = ProfileConstraints }; PlayFabClientAPI.GetFriendLeaderboard(getFriendLeaderboardRequest, (result) => { Debug.Log(result.Leaderboard.Count()); }, (error) => { Debug.LogError(error); });
i am trying to call the API when i am logged in when this PlabfabID = "4720617DB4FEF450" , and he has friends:
what do i do wrong?
all the other request working (get leaderboard).
Answer by Sarah Zhang · Oct 14, 2020 at 07:04 AM
We tested this API in our testing title, this API works fine. Could you please confirm whether these two friends have data under the corresponding leaderboard? If there are no these two rankings in the targeted leaderboard, the Leaderboard field in the response of GetFriendLeaderboard would be an empty array. You can navigate to these two player’s [Statistic] page to check their Statistics info.
Hey,
1. this players return when i call GetLeaderboard. so they have stats.
2. both of them had statistics as you can see:
Apologies for the delayed reply. We tried to create a testing account in your title, add these two players as friends, then call the GetFriendLeaderboard API. It can work fine.
Could you please check whether you use the correct statistic name in the request body? This is our testing request body.
{ "StatisticName": "Levels" }