Hey there, for our game we use leaderboards and have tested this in unity editor, and always worked,but whenever we build it for android the leaderboards never work
any idea where the problem could lie?
thanks
Hey there, for our game we use leaderboards and have tested this in unity editor, and always worked,but whenever we build it for android the leaderboards never work
any idea where the problem could lie?
thanks
What API call are you making, and what is the response? I can guarantee that leaderboards do work on all platforms, as it's the same API call regardless of platform. If they were failing, we'd be hearing about it from roughly 3K developers right now. :)
i use the "GetLeaderboardAroundPlayerRequest" and in unity the response is normal and can be used to fill ui or set other data , the same project build for android makes it never fill the ui.
i know playfab is cross platform and realize the problem is with me , just hearing if you had an idea where the problem is
We specifically don't interfere in the presentation layer of the game in any way, so it's not really clear why you're not seeing it displayed. Can you try debugging into your code and check the values coming back from PlayFab?
ive logged the result and on android neither success or error gets called , while on pc ive used the same way of debuggin and there it returns the last playfab id on success and the errormessage on error... so there is certainty that its not a playfab issue since it does not get called it seems , do you have any thoughts what i might be doing wrong though?
im sure the method gets called,this got logged
public void getLeaderBoard() { GetLeaderboardRequest levelRequest = new GetLeaderboardRequest() { StatisticName = "score", StartPosition = 0, MaxResultsCount = 50 }; PlayFabClientAPI.GetLeaderboard(levelRequest, (result) => //On success { Debug.Log("leaderboard returned with: " + result.Leaderboard); List<PlayerLeaderboardEntry> leaderboardData =new List<PlayerLeaderboardEntry>() ; foreach (PlayerLeaderboardEntry p in result.Leaderboard) { if (!p.PlayFabId.Equals(playfabid)) { leaderboardData.Add(p); } } watchtowerManager.setLeaderBoardArray(leaderboardData); }, (result) => //On fail { Debug.LogError("stats couldn't be retrieved"); }); }
this is the method i call to get the leaderboards and i add them in a list.
what is postman? and what do u mean with a network capture? send the incoming and outgoing requests from unity? or something else?
A network capture would be done using a tool like Wireshark (https://wiki.wireshark.org/SSL). But let's start more simply. Please put breakpoints into this, and let us know specifically what the values are for the parameters you're passing into the call, and the details of the response you get back.
Then, try the same call in Postman (https://api.playfab.com/docs/tutorials/execute-playfab-api-via-postman), and let us know the same - details of call and response.
2 People are following this question.