【发布时间】:2019-02-08 17:40:51
【问题描述】:
我正在使用最新版本的 GooglePlayGames 插件 (0.9.50)。我已经从游戏控制台添加了 Android 资源。我还验证了我的 SHA-1 指纹是正确的。 Google Play 控制台中上传证书的 SHA-1 指纹和 Google 开发者控制台中的 OAuth 2.0 客户端 ID 相同。仍然 Social.localUser.Authenticate 每次都返回 false 。添加测试人员的帐户后,我还尝试以 alpha 版本发布我的游戏。仍然 Social.localUser.Authenticate 返回 false。当我从手机打开游戏时,甚至没有显示 Google Play 游戏登录“绿色的东西”。我没有任何错误或警告。以下是我的代码:
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine;
using UnityEngine.SocialPlatforms;
using GooglePlayGames;
public class Playgames : MonoBehaviour {
public bool IsConnectedToGoogleServices { set; get; }
// Use this for initialization
void Start () {
#if (UNITY_ANDROID || (UNITY_IPHONE && !NO_GPGS))
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.Activate();
#endif
SignIn();
}
public bool SignIn()
{
if (!IsConnectedToGoogleServices) {
Social.localUser.Authenticate ((bool success) => {
IsConnectedToGoogleServices = success;
Debug.Log("Sign-in " + success.ToString() );
});
}
return IsConnectedToGoogleServices;
}
}
有人可以帮我解决这个问题吗?提前致谢。
【问题讨论】:
-
你的代码看起来和我的一模一样(关于登录部分)。所以这似乎不是代码问题。我最好的建议是在 google play 控制台中追溯您的步骤。注意:我确实使用了 alpha 轨道进行测试。
-
我已经对所有内容进行了三次检查。找不到问题:-(
标签: android unity3d google-play-services google-play-games google-play-console