public void GoogleSignIn()
{
if (!signedin)
{
Social.localUser.Authenticate((bool success) =>
{
if (success)
{
Debug.Log("yes");
}
else
Debug.Log("no");
});
}
}
public void GooglePlaySignInWithGS()
{
new GameSparks.Api.Requests.GooglePlusConnectRequest()
.SetAccessToken(PlayGamesPlatform.Instance.GetIdToken())
.SetDoNotLinkToCurrentPlayer(false)
.SetSwitchIfPossible(true)
.Send((Google_response) =>
{
if (!Google_response.HasErrors)
{
OnAuthentication(Google_response);
Debug.Log("done");
}
else
{
Debug.LogWarning(Google_response.Errors.JSON);
}
});
}
getIdToken()始终为null 任何帮助PLZ 谢谢。
答案 0 :(得分:0)
在某些版本的GPGS插件中检索访问令牌似乎存在问题。您应该能够使用服务器访问代码而不是访问令牌解决此问题。尝试替换
.SetAccessToken(PlayGamesPlatform.Instance.GetIdToken())
与
.SetCode(PlayGamesPlatform.Instance.GetServerAuthCode())