Hi i'm trying to integrate google play services into our playfab backend. After some trial and error we have managed to successfully log the user into the google play services and retrieve a server auth code. However trying to link it to an existing user seems to be failing.
This is our code that runs at awake.
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder() .AddOauthScope("profile") .RequestServerAuthCode(false) .RequestIdToken() .Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.DebugLogEnabled = true; PlayGamesPlatform.Activate();
This runs to authenticate a user in:
Social.localUser.Authenticate(callback);
And finally after a 1 second delay we run the blow code:
Debug.Log("Trying to login."); AuthId = PlayGamesPlatform.Instance.GetServerAuthCode(); Debug.Log($"Auth code is {AuthId}"); PlayFabClientAPI.LinkGoogleAccount(new LinkGoogleAccountRequest() { ServerAuthCode = AuthId }, AccountLinkSuccess, AccountLinkFail);
At which point our debug asserts that the login returns success, an oath code has indeed been provided but the API call to google returns the error : `invalid_client details: The OAth client was not found.`