简体   繁体   English

适用于Unity的Google Play游戏服务插件问题不允许我选择与Gamesparks集成的帐户

[英]Google Play Games Service Plugin For Unity Issue Not Let Me Choose The Account Intergrating With Gamesparks

I face a this problem 3 days. 我3天就遇到这个问题。 I can't figure it out what mistake i have done. 我无法弄清楚我犯了什么错误。

I have implementG GPGS plugin in unity with gamesparks too. 我也已经将G GPGS插件与gamesparks一起实现了。 The login goes successful. 登录成功。 But something is wierd in here is GPGS do not let me choose an GPGS account even i have 4 account. 但是这里有些奇怪的是,即使我有4个帐户,GPGS也不会让我选择GPGS帐户。

As i know when login with GPGS, the first login will attempt us to let us choose which account will we use to login. 据我所知,使用GPGS登录时,首次登录将尝试让我们选择我们将使用哪个帐户登录。

But in my problem whatever i do, switch account at playstore, switch account at google play games. 但是无论如何我都遇到了问题,在Playstore切换帐户,在Google Play游戏切换帐户。 The First login always use the same account to login. 首次登录始终使用相同的帐户登录。

Example : 范例:

I have 4 Account at playstore. 我在playstore有4个帐户。

  1. A@gmail.com A@gmail.com
  2. B@gmail.com B@gmail.com
  3. C@gmail.com C@gmail.com
  4. D@gmail.com D@gmail.com

When i try to login with GPGS, first login always choose A@gmail.com to login. 当我尝试使用GPGS登录时,首次登录总是选择A@gmail.com进行登录。 When i try to uninstall the game and then try to login. 当我尝试卸载游戏,然后尝试登录时。 Again always A@gmail.com is choose to login. 同样,总是选择A@gmail.com登录。 I don't know whats wrong with this. 我不知道这有什么问题。 Again i have switch the account at playstore, still i got the same A@gmail.com to login. 再次,我已经在playstore切换了帐户,但仍然可以使用相同的A@gmail.com登录。 There is not pop up for me at first to choose which want i choose for account. 首先我没有弹出选择我要为帐户选择的消息。

Below is my code : 下面是我的代码:

public void GooglePlusStart()
    {
        //Start the Google Plus Overlay Login

        Social.Active.localUser.Authenticate((bool success) => {
            if(success) {
                log.text = "SUCCESS AUTHENTICATED";
                GooglePlayAuthentication();
            } else{
                log.text = "FAILED AUTHENTICATED";
            }
            //Do something depending on the success achieved
        });

    }

public void GooglePlayAuthentication() {
        if(PlayGamesPlatform.Instance.IsAuthenticated()) {
                PlayGamesPlatform.Instance.GetServerAuthCode ((status, code) => {
                    string displayName = PlayGamesPlatform.Instance.GetUserDisplayName();
                    string email  = PlayGamesPlatform.Instance.GetUserEmail();
                    new GooglePlayConnectRequest ()
                        .SetCode (code)
                         //.SetAccessToken (PlayGamesPlatform.Instance.GetAccessToken ())
                        .SetDoNotLinkToCurrentPlayer (false)
                        .SetSwitchIfPossible(true)
                        .SetRedirectUri ("http://www.gamesparks.com/oauth2callback")
                        .SetDisplayName(displayName)
                        .Send ((googleplayAuthResponse) => {
                        if (!googleplayAuthResponse.HasErrors) {
                                Debug.Log (googleplayAuthResponse.DisplayName + " Logged In !");
                                log.text = "SUCCESSSSS    EMAIL : " + email + " ====== Status : " + status + "  ==== Code : " + code + " ====== " + "AccessToken : " + PlayGamesPlatform.Instance.GetAccessToken () + " ==== " + googleplayAuthResponse.DisplayName + "   :   " + googleplayAuthResponse.UserId + "   :   " + "Logged In! \n " + googleplayAuthResponse.JSONString;
                            } else {
                                Debug.Log ("Failed To Login");
                                log.text = "ERRRRORRRR    EMAIL : " + email + " ====== Status : " + status + " ==== Code : " + code + " ====== " + "AccessToken : " + PlayGamesPlatform.Instance.GetAccessToken () + " ==== " + googleplayAuthResponse.JSONString;
                            }
                        });
                });
        } else {
            log.text = "Google Play Login Failed";
        }
    }

If like this case, Of course i can't transfer my saved game to another device. 如果是这种情况,我当然无法将保存的游戏转移到另一台设备。

What mistake i have done so far ? 到目前为止,我犯了什么错误?

Any help would be appreciate. 任何帮助将不胜感激。

Thanks 谢谢

Dennis 丹尼斯

Found The Solution. 找到了解决方案。

See the screenshot below : 请看下面的截图:

在此处输入图片说明

When i tick "Enable Google Plus API Access" it worked. 当我勾选“启用Google Plus API访问权限”时,它起作用了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM