Hello,
Our game has several test users with statistics, that build up some leaderboards. I've been trying to retrieve those leaderboards using GetFriendLeaderboard in Unity. When I constantly recieved an empty array, I thought the problem might have something to do with the friends system, so I tried using GetLeaderboard. For some reason, this call would also return an empty array.
Wierdly enough, when I try to call GetLeaderboard through the "Try it" option in the relevant documentation page, everything works just fine. It seems like something in the call I make is not right, but I can't figure what.
These are the request and the call I make:
GetLeaderboardRequest levelRequest = new GetLeaderboardRequest() { StatisticName = SaveLoadController.current.saveHighestLevel, StartPosition = 0, MaxResultsCount = 0 }; PlayFabClientAPI.GetLeaderboard(levelRequest, (result) => //On success { Debug.Log("LEVEL returned with: " + result.Leaderboard.Count); highestLevels = result.Leaderboard; dataRetrieved++; if (dataRetrieved == expectedDataOfFriends) { Debug.Log("got enough info, adding friends"); AddFriendInfo(friendsInfo, highestLevels, highScores); } }, (result) => //On fail { Debug.LogError("User LEVEL stats couldn't be retrieved"); PlayFabErrorHandler.HandlePlayFabError(result); });
Thanks in advance,
Scholarly Orc team.