-2

using android version 6.0, play-games-plugin-for-unity v0.9.38a, unity 5.6.0f3.

Build and run direct from PC to android phone is working. Means my setting in google play console and unity is correct.

But after i remove the apps and download from google play store, the google pay Authentication did not work at all.

I'm so curious why direct from PC works but download from google play store cannot? Anyone have this same problem?

Here is the code.

using GooglePlayGames;
using GooglePlayGames.BasicApi;

.....
    void Start () {
        // Create client configuration
        PlayGamesClientConfiguration config = new 
            PlayGamesClientConfiguration.Builder()
            .Build();

        // Enable debugging output (recommended)
        PlayGamesPlatform.DebugLogEnabled = true;

        // Initialize and activate the platform
        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.Activate();


        PlayGamesPlatform.Instance.Authenticate(SignInCallback, false);


    }

    public void SignInCallback(bool success) {
        if (success) {
            txtUserName.text = Social.localUser.userName;
            isSignIn = true;
            txtSignInOut.text = "Sign Out";
            btnShowTopScore.SetActive (true);
        } else {
            txtUserName.text = "";
            isSignIn = false;
            btnShowTopScore.SetActive (false);
        }
    }
Kyo Kurosagi
  • 2,177
  • 1
  • 18
  • 18
  • 1
    hope this will help, it solved my problem. check out :- https://stackoverflow.com/questions/44153675/google-play-games-service-error-not-authorized-when-rollout-for-beta-unity3/44235859#44235859 – 9paradox May 29 '17 at 06:39

1 Answers1

1

Thanks Github issues, I had finally solve the solution. The problem is happen with Google app sign in.

From https://github.com/playgameservices/play-games-plugin-for-unity/issues/1754#issuecomment-304581707

What I did:

Google Play Console -> Select your app -> Release Management -> App signing -> App signing certificate : copy SHA-1 (dont copy word 'SHA1:')

open console.developers.google.com , select your project -> credentials -> OAuth 2.0 client IDs -> Edit OAuth client -> Signing-certificate fingerprint -> replace the old SHA1 with copied SHA1 ->save.

open you game, you should get sign in -> email selection -> select testers email. Google Play Games Services should work fine now.

and here is blog in case someone need it.

https://kyokurosagi.blogspot.my/2017/05/unity-local-login-with-unity-android.html

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Kyo Kurosagi
  • 2,177
  • 1
  • 18
  • 18