Unity Editor Version : 2019.4.28f1
Hi. Same system works fine on android but I have problem on IOS.
ILeaderboard mLeaderBoard = Social.CreateLeaderboard();
mLeaderBoard.id = "leaderboardID";
mLeaderBoard.userScope = UserScope.Global;
mLeaderBoard.timeScope = TimeScope.AllTime;
mLeaderBoard.range = new Range(1, 30);
mLeaderBoard.LoadScores(result =>
{
if (result)
{
Debug.Log("Scores Length : " + mLeaderBoard.scores.Length); //Output : "Scores Length : 30"
List<string> userIDs = new List<string>();
for (int i = 0; i < mLeaderBoard.scores.Length; i++)
userIDs.Add(mLeaderBoard.scores[i].userID);
Debug.Log("UserIDs Count : " + userIDs.Count); //Output : "UserIDs Count : 30"
Debug.Log("UserID[0] : " + userIDs[0]); //Output : "UserID[0] : 162334654......"
Debug.Log("Player ID : " + Social.localUser.id); //Output : "Player ID : T:_9953b2d1m32......"
Social.LoadUsers(userIDs.ToArray(), (users) =>
{
Debug.Log("Users Length : " + users.Length); //Output : "Users Length : 0"
});
}
});
Although 30 Scores are returned, users information is not loaded. Social.LoadUsers function returns user array of length is 0.
It also gives the following error in XCode Console :
I noticed here that the userID of the users on the leaderboard are not similar to Social.localuser.id. Different types. So I tried using Social.LoadUsers function with Social.localuser.id
List<string> userIDs = new List<string>();
userIDs.Add(Social.localUser.id);
Social.LoadUsers(userIDs.ToArray(), (users) =>
{
Debug.Log("Users Length : " + users.Length); //Output : "Users Length : 0"
});
But the result is the same. Social.LoadUsers function returns 0. But this time it didn’t give any error in XCode Console.