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. Response avatar

    Resolution Note (fix version 2021.2):

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

  2. Response avatar

    Resolution Note (fix version 2021.1):

    Fixed in 2021.1.3f1

  3. Response avatar

    Resolution Note (fix version 2020.3):

    Fixed in 2020.3.6f1

  4. Response avatar

    Resolution Note (fix version 2019.4):

    Fixed in 2019.4.25f1

Comments (7)

  1. 343497b83827bc59ef4e7c0b3c189dc1?d=mm

    GladStudio

    Jul 21, 2021 09:32

    And how do I get names now with Social.Active.LoadUsers? LoadUsers requires the old ID and IScore contains the new one. This is such nonsense.

  2. 2024a72ae6c30b5de61472c7485f3ed9?d=mm

    matt_unity258

    Jun 29, 2021 13:25

    version Version '2020.3.3f1 (76626098c1c4)' works for me so the fix in Fixed in 2020.3.6f1 probably ruined something

  3. 2024a72ae6c30b5de61472c7485f3ed9?d=mm

    matt_unity258

    Jun 29, 2021 10:32

    Im having the same issue on engine version: 2020.3.11f1 (99c7afb366b3)

  4. Fb568dfd5295f130a33fc727242261e7?d=mm

    michaeldobele

    Jun 24, 2021 06:57

    I'm using Unity 2020.3.12f1 and am unable to get the correct ID to pass into Social.Active.LoadUsers

    I tried to fetch scores from a friend leader board with the scope set to this week only and I'm still getting three different IDs and their username is just "Unknown" with friendFlag set to "false".

    When I log out the friends ID at each step of the process they are all different.

    Friend ID returned from Social.localUser.LoadFriends - 162451708288547808
    Friend ID returned from localLeaderboard.LoadScores - 162451708373532384
    Friend ID returned in the profiles from Social.Active.LoadUsers - 162451708425354208

  5. 5b932adce27ee18c8f7cb4d642978b4d?d=mm

    lowLevell

    Jun 15, 2021 01:57

    The issue continues.

  6. 5b932adce27ee18c8f7cb4d642978b4d?d=mm

    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.