playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.44k stars 959 forks source link

Unable to login to firebase by google play games. ( losing player accounts) #3052

Closed cometa93 closed 3 years ago

cometa93 commented 3 years ago

Hello, we have a huge, huge, huge problem. We are using google play games with success, but we can't use RequestAuthCode() because our OAuth Consent is not getting reviewed for half a year already!!!

Our code looks like this:

PlayGamesClientConfiguration config;
            if (GameMaster.Firebase.IsSafeToUse &&
                GameMaster.Firebase.Config.GetBoolValue(FirebaseConfig.TAG_IS_GPG_AUTH_REQUEST_CONSENT_ENABLED))
            {

                config = new PlayGamesClientConfiguration.Builder()
                    .RequestServerAuthCode(false)
                    .Build();
            }
            else
            {
                config = new PlayGamesClientConfiguration.Builder()
                    .Build();
            }

We were able to connect accounts, but the player can't request auth code, so can't grant access to his account (connected to firebase already, somehow a few players were able to get auth code) after coming back to the game after a while or after uninstalling the game.

The problem is, we receive the status code: 4 https://stackoverflow.com/questions/54010800/google-play-games-android-sign-in-getting-error-code-4

We receive info that we have to show UI but it's getting automatically killed, in logcat we see that we NEED_USER_CONSENT. We have filled the questionary, we have verified domains, we have privacy policies, terms of service etc...

And right after when we try to show UI but with error status 10 dev error... We have correct credentials set ( quadra checked).

Please help.

Without this line: .RequestServerAuthCode(false)

Google play signs in correctly.

Harindulk commented 3 years ago

I already faced problem like this

cometa93 commented 3 years ago

Ok, so I have sorted out this thing. There was a different issue, actually. PlayGamesPlatform.Instance

is a singleton that is initializing google play with default configuration if it wasn't initialized earlier on.

Firebase Auth is signing in the user straight after initialization of firebase if it is available.

We were trying to link google play automatically if a user is logged in, because we use an anonymous login, after the update players were already logged in. PlayGamesPlatform.Instance was called and initialized our google play without .RequestServerAuthCode(false).

.RequestServerAuthCode(false) do not require any consent.