Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity Social.LoadUsers Problem on Game Center IOS

Discussion in 'iOS and tvOS' started by lowLevell, Jun 15, 2021.

  1. lowLevell

    lowLevell

    Joined:
    Nov 22, 2013
    Posts:
    27
    Unity Editor Version : 2019.4.28f1

    Hi. Same system works fine on android but I have problem on IOS.

    Code (CSharp):
    1.         ILeaderboard mLeaderBoard = Social.CreateLeaderboard();
    2.         mLeaderBoard.id = "leaderboardID";
    3.         mLeaderBoard.userScope = UserScope.Global;
    4.         mLeaderBoard.timeScope = TimeScope.AllTime;
    5.         mLeaderBoard.range = new Range(1, 30);
    6.  
    7.         mLeaderBoard.LoadScores(result =>
    8.         {
    9.             if (result)
    10.             {
    11.                 Debug.Log("Scores Length : " + mLeaderBoard.scores.Length); //Output : "Scores Length : 30"
    12.  
    13.                 List<string> userIDs = new List<string>();
    14.  
    15.                 for (int i = 0; i < mLeaderBoard.scores.Length; i++)
    16.                     userIDs.Add(mLeaderBoard.scores[i].userID);
    17.  
    18.                 Debug.Log("UserIDs Count : " + userIDs.Count); //Output : "UserIDs Count : 30"
    19.                 Debug.Log("UserID[0] : " + userIDs[0]); //Output : "UserID[0] : 162334654......"
    20.                 Debug.Log("Player ID : " + Social.localUser.id); //Output : "Player ID : T:_9953b2d1m32......"
    21.  
    22.                 Social.LoadUsers(userIDs.ToArray(), (users) =>
    23.                 {
    24.                     Debug.Log("Users Length : " + users.Length); //Output : "Users Length : 0"
    25.                 });
    26.             }
    27.         });
    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

    Code (CSharp):
    1.         List<string> userIDs = new List<string>();
    2.         userIDs.Add(Social.localUser.id);
    3.  
    4.         Social.LoadUsers(userIDs.ToArray(), (users) =>
    5.         {
    6.             Debug.Log("Users Length : " + users.Length); //Output : "Users Length : 0"
    7.         });
    But the result is the same. Social.LoadUsers function returns 0. But this time it didn't give any error in XCode Console.
     
    Last edited: Jun 15, 2021
  2. lowLevell

    lowLevell

    Joined:
    Nov 22, 2013
    Posts:
    27
  3. matt_unity258

    matt_unity258

    Joined:
    Dec 4, 2017
    Posts:
    17
    Any success with this?
     
  4. matt_unity258

    matt_unity258

    Joined:
    Dec 4, 2017
    Posts:
    17
    version Version '2020.3.3f1 (76626098c1c4)' works for me so the fix in Fixed in 2020.3.6f1 probably ruined something

    (You should try a version before the fix in 2019.4.25f1 if you want to use 2019)
     
  5. lowLevell

    lowLevell

    Joined:
    Nov 22, 2013
    Posts:
    27
    There is no solution yet.
     
  6. matt_unity258

    matt_unity258

    Joined:
    Dec 4, 2017
    Posts:
    17
  7. lowLevell

    lowLevell

    Joined:
    Nov 22, 2013
    Posts:
    27
    I tried on Unity 2019.4.31f1, the issue still continues.
     
  8. spikyworm5

    spikyworm5

    Joined:
    Jul 13, 2020
    Posts:
    31
    Reproduced with 2020.3.21f1. Any news or plans to fix this issue? This is currently the only issue that holding me from using the Social module. Android works perfectly.