I have successfully implemented the latest PlayFab SDK and Play Games Plugin v0.96 in our Unity Project.
The game startup procedure is the following:
- Login to PlayFab using a device ID
- Login to Google Play Game Services using Social.localUser.Authenticate
- Call GetAccountInfo to get basic player data from PlayFab (including linked Google ID)
- If the Google ID from GetAccountInfo is empty or different from the one obtained from Play Games Plugin we call GetPlayFabIDsFromGoogleIDs to check if the current Play Games ID is linked with other PlayFab account or not.
- Further actions including LinkGoogleAccount or LoginWithGoogleAccount depending on the result of GetPlayFabIDsFromGoogleIDs and the player's choice to resume progress.
So far I managed to successfully login the player to PlayFab, login to Play Games and link the accounts.
However, I have encountered two problems:
- The first problem is that for some Google accounts the PlayGamesPlatform.Instance.GetUserId(); returns a different player ID than the one retrieved from PlayFab with GetAccountInfo. The Player ID obtained from Play Games Plugin has letter 'g' plus 20 digits (i.e. 'g12345678901234567890') while the Google ID obtained from PlayFab consists of 21 digits (i.e. '123456789012345678901').
I assume it's connected with this Google Play change, and PlayFab is storing the Google user ID instead of the Player ID that is returned by the Play Games Unity Plugin. - If I feed the ID returned by the Google Play Games Plugin to GetPlayFabIDsFromGoogleIDs it returns an empty string instead of a PlayFab ID so I am unable to tell if the Play Games account is already linked to PlayFab or not which is crucial for the game startup procedure and PlayFab integration.
Is there any way to obtain the PlayFab ID from the new Google Player ID format ('g' + 20 digits)?
Or maybe you know how to obtain the Google user ID from the Play Services Plugin (21 digits without the 'g')?