【发布时间】:2018-05-30 16:10:59
【问题描述】:
您好:我一直在努力让我的应用进行身份验证。我已将 APK 部署到我的 Galaxy 并发生以下情况: Unity 游戏打开,出现“连接到...”对话框,出现“Google Play”绿色对话框,对话框消失并显示加载指示器,然后我得到“错误”结果.
我在 Start() 中有以下内容:
PlayGamesPlatform.Activate();
PlayGamesPlatform.DebugLogEnabled = true;
AuthenticateGoogle();
以及 AuthenticateGoogle() 中的以下内容:
private bool AuthenticateGoogle()
{
isAuthorized = false;
Social.localUser.Authenticate((bool result) => {
isAuthorized = result;
if (!result)
{
GameObject.Find("errText").GetComponent<Text>().text = result.ToString();
}
});
return isAuthorized;
}
我使用 Unity UI 创建了一个新的 Keystore,输入了密码并构建了 .APK。然后,我在 Google Play 控制台中创建了一个新应用程序并将 .APK 上传到它。接下来我创建了一个新的游戏服务并链接了该应用程序,允许它信任该应用程序。我创建了一个排行榜。我确保我的用户在测试部分。最后,我从排行榜下的获取资源部分复制 XML 到我的 Unity 项目并构建项目,复制到我的手机。
有什么想法吗?我还能做些什么来解决身份验证与真/假结果的问题?
【问题讨论】:
-
当我链接我的应用时,我获得了一个新的客户身份(以 .apps.googleusercontent.com 结尾)。我需要在 Unity 中做任何事情来链接我的应用程序的构建吗?
标签: c# android unity3d google-play-games