Search Issue Tracker

Fixed in 2021.2.X

Fixed in 2019.4.X, 2020.3.X, 2021.1.X

Votes

0

Found in

2018.4

2019.4

2020.2.3f1

2020.3

2021.1

2021.2

Issue ID

1312882

Regression

No

[iOS] Social API score.userID returns a legacy ID from GameCenter

iOS

-

Steps to reproduce:
1. Open the attached project ("1312882.zip")
2. Build and deploy the Xcode project to a device
3. Press "Auth" button (authorizes the player to GameCenter)
4. Check the localUserI.id value in Xcode console
5. Press "commit scores" button
6. Press "LoadScore" button
7. Check the score.userID value returned from GameCenter

Expected results: score.userID returns the same ID as localUserID
Actual results: score.userID returns a legacy ID

Reproducible with: 2018.4.32f1, 2019.4.22f1, 2020.3.0f1, 2021.1.0b11, 2021.2.0a8

Notes:
- Possibly related to Case 1176134 (https://issuetracker.unity3d.com/product/unity/issues/guid/1176134/)

  1. Resolution Note (fix version 2021.2):

    Fixed in 2021.2.0a11
    Note: scores submitted before the fix will still return a legacy ID

  2. Resolution Note (fix version 2021.1):

    Fixed in 2021.1.3f1

  3. Resolution Note (fix version 2020.3):

    Fixed in 2020.3.6f1

  4. Resolution Note (fix version 2019.4):

    Fixed in 2019.4.25f1

Comments (12)

  1. lowLevell

    Jun 15, 2021 01:57

    The issue continues.

  2. lowLevell

    Jun 15, 2021 01:55

    Unity Editor Version : 2019.4.28f1

    Code :

    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 :

    "GKPlayer: _loadPlayersForIdentifiers: - Failed to get profiles for Player IDs due to error: Error Domain=GKErrorDomain Code=8 "The requested operation could not be completed because the player is invalid." UserInfo={GKServerStatusCode=5005, NSLocalizedDescription=The requested operation could not be completed because the player is invalid., NSUnderlyingError=0x600000e11d70 {Error Domain=GKServerErrorDomain Code=5005 "status = 5005, NO SUCH PLAYER ID" UserInfo={GKServerStatusCode=5005, NSLocalizedFailureReason=status = 5005, NO SUCH PLAYER ID}}} "

    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:

    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.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.