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

Bug Social API LoadUsers() not working with IScore IDs anymore

Discussion in 'iOS and tvOS' started by kilicbatuhan1205, May 23, 2021.

  1. kilicbatuhan1205

    kilicbatuhan1205

    Joined:
    Dec 20, 2018
    Posts:
    27
    Hello,

    apparently, in Unity 2019.4.25f1, the user ID that IScore#userId returns was changed. Since that change, trying to use LoadUsers() with the new ids only results in empty IUserProfiles. Seems like they are not compatible anymore. The loadPlayers() method is also deprecated in Apple's GameKit, because you can now access the GKPlayer right from the GKLeaderboardScore object. Am I missing something or is this a bug?
     
  2. michaeldobele

    michaeldobele

    Joined:
    Oct 25, 2016
    Posts:
    10
    I'm having the same issue. I'm currently using Unity 2020.3.12f1

    I'm reading in a Friends scoped leaderboard ok, the scores received match up to what I see on the iOS Game Center UI.

    I then pass the userIDs from that returned leaderboard over to Social.LoadUsers() in order to get those friends User Names and Images etc to display in-game. Social.LoadUsers returns a set of IUserProfile[] profiles correctly but the IDs in there don't match the original score IDs I passed and all of the names come back as "unknown" and the isFriend flag is "false".

    Anyone know how to get correct info from a friends leaderboard on iOS to display in-game?
     
  3. michaeldobele

    michaeldobele

    Joined:
    Oct 25, 2016
    Posts:
    10
    I read a note on this bug report that : Note: scores submitted before the fix will still return a legacy ID
    https://issuetracker.unity3d.com/is...ot-userid-returns-a-legacy-id-from-gamecenter

    However when I tried to fetch scores from a friend leader board with the scope set to this week only I'm still getting three different IDs and unable to get their username.

    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
     
  4. matt_unity258

    matt_unity258

    Joined:
    Dec 4, 2017
    Posts:
    17
    Same problem for me
     
  5. TEEBQNE

    TEEBQNE

    Joined:
    Jan 25, 2017
    Posts:
    88
    I am also getting this issue. Is there any fix? My leaderboards were working perfectly fine but now all usernames aside from the local user show up as Unknown when I pull leaderboard data.
     
  6. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    832
    was there a fix for this? I'm getting "Unknown" as user names.

    Unity 2019.4.31f & Unity 2020.3.21f1

    reported here:

    https://issuetracker.unity3d.com/is...ot-userid-returns-a-legacy-id-from-gamecenter

    Using the following code to get usernames (returns "Unknown")

    Code (CSharp):
    1. leaderboard.LoadScores(result =>
    2.         {
    3.             List<string> userIds = new List<string>();
    4.             foreach (IScore score in leaderboard.scores)
    5.             {
    6.                 Debug.Log(score);
    7.                 userIds.Add(score.userID);
    8.             }
    9.             Social.LoadUsers(userIds.ToArray(), (users) =>
    10.             {
    11.                 for (int i = 0; i < users.Length; i++)
    12.                 {
    13.                     Debug.Log(users[i].userName);
    14.                 }
    15.             });
    16.         });
     
    Last edited: Dec 30, 2021
  7. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    832
    Incase anyone finds this thread, Unity got back to me about this issue. Heres the official word:

    "Work on Game Center integration is currently on hold. If you are experiencing issues with Game Center implementation as an alternative we recommend using Game Center solutions from Asset Store or implementing your own solution."
     
    damelin likes this.
  8. Arkadal

    Arkadal

    Joined:
    Feb 25, 2022
    Posts:
    1
    The issue exists in Unity 2020.3.26f.
     
  9. TEEBQNE

    TEEBQNE

    Joined:
    Jan 25, 2017
    Posts:
    88
    The issue will exist in every Unity version. Their package is not updated to work with Apple's new ID system. Until the Unity social package is updated to be compatible, regardless of Unity version, you will have this issue.
     
    ark-unity-user1 likes this.
  10. TeorikDeli

    TeorikDeli

    Joined:
    Apr 6, 2014
    Posts:
    117
    Still have this issue. Just because of that (and Apple's unityplugins package crashes the app) we have to change our game UI, to open Game Center's native UI =(