成功登录帐户后,我尝试获取后端的授权令牌。但它始终是空的。是否缺少一些代码,或者可能是 sha-1 指纹或其他什么?
private void Start()
{
PlayGamesPlatform.Activate();
LoginGooglePlayGames();
}
private void LoginGooglePlayGames()
{
PlayGamesPlatform.Instance.Authenticate((success) =>
{
if (success == SignInStatus.Success)
{
Debug.Log("Login with Google Play games successful.");
PlayGamesPlatform.Instance.RequestServerSideAccess(true, code =>
{
Debug.Log("Authorization code: " + code);
Token = code;
OnGetAuthToken?.Invoke(code);
});
}
else
{
Debug.Log("Failed to retrieve Google play games authorization code");
}
});
}