Unity 2019 changed Social.localPlayer.id to use the GameCenter Team ID (as per apple guidelines)
We're currently updating our build from Unity 2018.4 to 2019.4 and this gamecenter ID issue is going to cause issues for existing players who are using the Old GameCenter id.
Is it possible to connect a player with BOTH Game Center IDs?
My current plan is as follows:
Make a check PlayFab for the new GameCenter ID:
var request = new GetPlayFabIDsFromGameCenterIDsRequest() { GameCenterIDs = new List<string>() { Social.localUser.id }, }; PlayFabClientAPI.GetPlayFabIDsFromGameCenterIDs(request, ...)
if no PlayFab id is returned, THEN try the legacy GC ID
string legacyId = ((UnityEngine.SocialPlatforms.Impl.UserProfile) UnityEngine.Social.localUser).legacyId; var request = new GetPlayFabIDsFromGameCenterIDsRequest() { GameCenterIDs = new List<string>() { legacyId }, }; PlayFabClientAPI.GetPlayFabIDsFromGameCenterIDs(request, ...)
If neither ID exists, then just login/create a user with Social.localUser.id otherwise use whichever id already has a PlayFab user.
Then, if we have logged in using the Legacy ID... then call PlayFabClientAPI.LinkGameCenterAccount with the new GameCenterID to link both accounts.
Will that work?
How has everyone managed Legacy gamecenter IDs in Unity/Playfab ?