UNITY:从Google Play商店下载时,Google Play身份验证失败 [英] UNITY: Google Play Authentication failed when download from Google Play store

查看:711
本文介绍了UNITY:从Google Play商店下载时,Google Play身份验证失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用android 6.0版,Play-games-plugin-for-unity v0.9.38a,统一5.6.0f3.

PC 生成并直接运行 Android手机正在正常运行.表示我在Google Play控制台中的设置和统一性是正确的.

但是在我删除应用程序从Google Play商店下载后,谷歌付费身份验证完全无效.

我很好奇为什么可以直接从PC上运行但不能从 google play store 下载? 有人遇到同样的问题吗?

这是代码.

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);
        }
    }

解决方案

感谢Github问题,我终于解决了该解决方案.问题是Google应用程序登录时发生的.

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

我做了什么:

Google Play控制台->选择您的应用->版本管理->应用签名->应用签名证书:复制SHA-1(不要复制单词'SHA1:')

打开console.developers.google.com,选择您的项目->凭据-> OAuth 2.0客户端ID->编辑OAuth客户端->签名证书指纹->将旧的SHA1替换为复制的SHA1->保存.

打开游戏,您应该登录->电子邮件选择->选择测试人员的电子邮件. Google Play游戏服务现在应该可以正常工作.

这是博客,以防万一有人需要它.

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

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);
        }
    }

解决方案

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

这篇关于UNITY:从Google Play商店下载时,Google Play身份验证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆