unity3d 为什么Google Play游戏授权在Unity中不起作用?

14ifxucb  于 2023-02-23  发布在  Go
关注(0)|答案(1)|浏览(291)

我做对了一切,我在Google API中指定了SHA1,将其全部链接到Google控制台,将资源和Web客户端ID插入到Unity中,但每次我尝试登录时,它都会写入“已取消”。
在LogCat中,我没有收到错误,只有:

*** [Play Games Plugin 0.11.01] 02.18.23 ERROR: Returning an error code
GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
Google Play services out of date for iae.perfectray.dogs. Reqires 21300000 but found 212621032

以下是授权码:

using GooglePlayGames;
using GooglePlayGames.BasicApi;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Auth : MonoBehaviour
{
    // Start is called before the first frame update
    public Text text;
    void Start()
    {
        PlayGamesPlatform.Activate();
        PlayGamesPlatform.DebugLogEnabled = true;
    }
    public void Authh()
    {
        PlayGamesPlatform.Instance.Authenticate(ProccessAuth);
    }
    internal void ProccessAuth(SignInStatus status)
    {
        if(status == SignInStatus.Success)
        {
            text.text = "Status: Succesfull";
            
        }
        else
        {
            text.text = "Status: " + status;
         
            
        }
    }

我什么都试过了,都没用

a14dhokn

a14dhokn1#

确保您已经创建了发布密钥库并将其添加到项目中。
此外,在创建Web客户端ID时,应该在Google控制台中提到SHA1代码。
你可以参考下面链接中提到的答案,在你的Unity项目中设置google认证。
https://stackoverflow.com/a/75517842/7103882
更多信息:

演示项目链接:https://github.com/codemaker2015/google-signin-unity3d-demo

相关问题