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

Question Unity iOS Social API Id

Discussion in 'Scripting' started by melterx12, Feb 4, 2021.

  1. melterx12

    melterx12

    Joined:
    Jan 20, 2019
    Posts:
    16
    Hi, I am having an issue with the Unity Social API, or perhaps more specifically Apple's recent changes to Game Center.

    Upon starting my game and successfully authenticating with Game Center I want to try to load the user's high score if one exists and retrieve it by matching on the Player's Id.

    From what I understand, the Social API's localUser.id property is currently retrieving game center's TEAM ID. However, the Social.LoadScore method returns a list of scores who's Id is the GAME ID (or maybe something else, but definitely not the TEAM ID).

    How can I match these scores if the Id's are different? I do not want to match on player name as the name can change.

    Any help is appreciated.
     
  2. melterx12

    melterx12

    Joined:
    Jan 20, 2019
    Posts:
    16
    update: still looking for help on this, but I have found some additional info from Apple's documentation - the current player properties for a GKPlayer associated with a score should include both the Team ID and Game ID. It seems that this is a bug or deficiency in Unity's Social API that the LoadScore method returns scores with only one Id (the Game ID).

    In this case is there anything that can be done from my end short of implementing my own GameCenter integration from scratch?
     
  3. melterx12

    melterx12

    Joined:
    Jan 20, 2019
    Posts:
    16
    anyone?
     
  4. melterx12

    melterx12

    Joined:
    Jan 20, 2019
    Posts:
    16
    update for anyone interested (although feels like I'm talking to myself in here), after some more experimentation I came to the realization the the id associated with the scores for Social's GameCenter implementation is actually the legacy id, which is obsolete. I will submit a bug report to unity as this ID should be updated to return either the team id or game id (or preferably expose both)
     
    Last edited: Feb 7, 2021
    VolodymyrBS likes this.
  5. ShockFactor

    ShockFactor

    Joined:
    Sep 30, 2015
    Posts:
    8
    I have this issue also with load scores vs load users. Two different IDs returned. Can't currently match them when the response data shows up. I load the scores, feed the iScore array into the load users call and the ID returned is different. This is Just iOS. The Google play social interface implementation seems to be working. You have a link to the bug you submitted so I can upvote it?
     
  6. melterx12

    melterx12

    Joined:
    Jan 20, 2019
    Posts:
    16
    Unfortunately I have lost the link to the report and I can’t find it on the bug tracker, but I have been contacted by someone from Unity’s Customer QA team regarding this so hopefully they are looking into it.
     
  7. melterx12

    melterx12

    Joined:
    Jan 20, 2019
    Posts:
    16
    ShockFactor likes this.
  8. matt_unity258

    matt_unity258

    Joined:
    Dec 4, 2017
    Posts:
    17
    Im having the same issue on engine version: 2020.3.11f1 any ideas what to do?
     
  9. 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
     
  10. matt_unity258

    matt_unity258

    Joined:
    Dec 4, 2017
    Posts:
    17
  11. TEEBQNE

    TEEBQNE

    Joined:
    Jan 25, 2017
    Posts:
    88
    Any update on this issue?
     
  12. dustinbahr

    dustinbahr

    Joined:
    Sep 10, 2012
    Posts:
    57
    Is there any 2020 version of Unity that is working for Social.LoadUsers? Don't want to wait for unity to fix this.
     
  13. TEEBQNE

    TEEBQNE

    Joined:
    Jan 25, 2017
    Posts:
    88
    There are currently no Unity versions that will work with LoadUsers. Unity has to update its Social library that integrates Game Center calls. You can probably revert the version of the Social package you are using, but as iOS is deprecating or has deprecated the old IDs, it would not be wise to do that. The bug tracker page says it either needs major refactoring which makes no sense as it is a function call change or it is a feature request which also does not make sense as it's not a feature, it's part of the core functionality.

    The only real fix, for now, is writing your own implementation or getting a package from the asset store to replace Unity's social implementation for iOS. If you do not want to do either of these, you will need to wait for Unity to update. Sadly there has been no real communication from them about any progress on this issue so we are in the dark in terms of any eta. All the bugtracker page says is Game Center integration is on hold, so I would not get your hopes up for anything soon.