8 Replies
      Latest reply on Sep 23, 2019 8:06 PM by nasj442
      RajDoshi Level 1 Level 1 (0 points)

        I watched the video on Game Center Player Identifiers and saw that GKPlayer's playerId is deprecated in iOS 13, to be replaced with gamePlayerId and teamPlayerId. https://developer.apple.com/videos/play/wwdc2019/615/


        Our games allow players to login with Game Center to join and play games hosted on our servers. We use playerId to identify players so that they can play and earn rating points under their own account. The video says to transition to using teamPlayerId to identify players, which by itself isn't too complicated, but I'm concerned that this hasn't been fully thought through and some players may lose access to their accounts in systems like ours.


        1. As player's login during the transition period, we will need to read both playerId and teamPlayerId in order to change their account on our servers to the new id. After the transition, when playerId is removed from iOS, it seems that any player who hasn't logged in, perhaps returning to the app after a long break, will no longer be able to access their previous account. They will appear to us as a completely new player. It seems we need some proactive way, like a server API, to convert playerId values to the new teamPlayerId.


        2. In the video, the presenter says that there is a "very rare case" when teamPlayerId and gamePlayerId will not be available to uniquely identify the player. In this case, we will have no method of identifying the player and allowing them to access an account on our servers. Nothing is explained about what this "very rare case" is or how to help users correct this. Slide 13 shows how to check for the error case, but does not provide any example error message or error handling.


        3. We use GKLocalPlayer's generateIdentityVerificationSignatureWithCompletionHandler API to authenticate players on our servers. This API has not been updated, and it's documentation still says to use playerId. It seems a new API will be needed to deal with players having multiple, different ids.


        I'm interested to hear from other developers who use Game Center as a login method for their own servers and are facing these kinds of issues. I'm hoping this post might get the attention of someone at Apple, but I'll also try to engage them in other ways and report anything I find out.

        • Re: Issues Surrounding GKPlayer's playerId Deprecation in iOS 13
          gguo2 Level 1 Level 1 (0 points)



          We really need updated information about generateIdentityVerificationSignatureWithCompletionHandler

          • Re: Issues Surrounding GKPlayer's playerId Deprecation in iOS 13
            LoPing Level 1 Level 1 (0 points)

            Has anyone successfully used GKPlayer.loadPlayers(forIdentifiers: , withCompletionHandler:) using either gamePlayerIDs or teamPlayerIDs for as "forIdentifiers"?


            My game happily used loadPlayer() for playerIDs (since deprecated), but I always get an empty GKPlayer array (no error code) from using the function now with gamePlayerIDs or teamPlayerIDs.  Build 12.4.

            • Re: Issues Surrounding GKPlayer's playerId Deprecation in iOS 13
              cdubfoo Level 1 Level 1 (0 points)

              FYI, .playerID is still working in iOS 13, though it likely will stop working in a future version.  Perhaps this info is useful to someone.

              • Re: Issues Surrounding GKPlayer's playerId Deprecation in iOS 13
                nasj442 Level 2 Level 2 (45 points)

                Here are my findings regarding gamePlayerIDs and teamPlayerIDs:


                1. I can get the localPlayer's gamePlayerID and teamPlayerID with no problem.  I have never had scopedIDsArePersistent be false.  However, for my app the two IDs are the same, for some reason.  The teamPlayerID is of the form "T:_<32 hex digits>", whereas the old playerID used to be "G:<10 decimal digits>".


                2. I can NOT get the teamPlayerID for an opponent.  In a real-time match, [myGKMatch.players objectAtIndex:0].scopedIDsArePersistent is always false.  If I attempt to read the teamPlayerID field anyway, I get a 16 digit hex string (with no "T:_" prefix), and this string doesn't ever appear to be the same string twice, even for the same opponent.  I also tried this with a turn-based match, where I found the opponent's GKPlayer through a GKTurnBasedParticipant array, with the same results.


                I don't know if we are supposed to be able to get the teamPlayerID of an opponent, but this always used to work for playerIDs.

                  • Re: Issues Surrounding GKPlayer's playerId Deprecation in iOS 13
                    RajDoshi Level 1 Level 1 (0 points)

                    We put some analytics in our apps that track the return values of scopedIDsArePersistent for the local player, and we are seeing a small percentage of players on iOS 13 where the value is false, as Apple said to expect. Once playerId is gone, I'm still not sure how we're supposed to identify these users on our servers. On iOS 12.4, scopedIDsArePersistent was not available, but we have still seen users where the game/team player ids have changed. As a result, we have users accounts in our system that have a single "G:" or "U:" playerId value, but multiple "A:" and "T:" values. I went ahead and filed a bug report for this (FB7137603). We're also seeing another bug where occassionally we receive the values "UnknownID" and "Unavailable Player Identification" for the game/team player ids (FB7137454), so we're ignoring those values now. Coinciding with the public release of iOS 13.0, we also started receiving some empty string values for game/team player ids.