We're having multiple issue/questions when trying to use Google SignIn with the new ServerAuthCode method.
1) Under Addons->Google in the Game Manager one should put their ClientId and ClientSecret. So under the Google Developer Console, is that ClientSecret for iOS the "iOS Key" that is displayed under API-Keys?
2) Is it actually possible to use Google SignIn with ServerAuthCode with both iOS and Android? In the Game Manager one can only put one ClientID and one Client Secret under Addons->Google. According to Google iOS should have a different ClientId then Android.
3) When trying to log in with Google ServerAuthCode under iOS with the C++ SDK we're getting this error. (Title ID D73D, in case you want to have a look)
(const PlayFab::PlayFabError) $0 = { HttpCode = 400 HttpStatus = "BadRequest" ErrorCode = 1026 ErrorName = "InvalidGoogleToken" ErrorMessage = "Google API error code: invalid_client details: Unauthorized" ErrorDetails = size=0 {}}
But this might simply not work because iOS with ServerAuthCode is not supported at all.
4) This ServerAuthCode is a one-time only use code, right? We haven't found a way yet to request a new serverAuthCode from Google yet neither in the iOS nor the Android SDK. Actually the serverAuthCode in the Google iOS SDK is only present after the login-screen was displayed. If the user logs in at a later time, with a new session, Google SignIn is successful but the serverAuthCode is simply nil.
The case when we need multiple serverAuthCodes is:
a) User tries to link his GoogleAccount with his current PlayFabAccount
b) We realize that this GoogleAccount is already linked to an account and get an error, serverAuthCode is used now.
c) Now we want to temporarily login to this PlayFab Account, linked with Google, to show the player this account's data and let the player decide which account he wants to use.
d) If player decides to use this Google-linked account, we log back into the device-linked account and unlink the device
e) We log back into the Google-Linked account and link the device again. This is now the main account.
This process needs a total of 3 serverAuthCodes, if I'm not completely off ;)
With the old AccessTokens this was easily possible, since they could be reused.
The problem is that using AccessTokens on Android requires an additional consent-confirmation by the user in Google Play Games Services, which we're trying to avoid.
5) In case all this won't work, can we still safely use the old way of AccessTokens? Or will it soon be removed?