【发布时间】:2019-06-03 14:15:17
【问题描述】:
我在尝试在我的 android 游戏上进行身份验证时遇到问题,我使用 playfab + google play 服务在 google 上进行身份验证,但我什至无法使用 google 帐户在 playfab 上进行身份验证,Social.localUser.Authenticate never成功并且它在回调中返回的消息是“身份验证已取消”,我得到的唯一有用的日志消息是
[Play Games Plugin DLL] 应用程序正在暂停,这会断开连接 RTMP 客户端。离开房间。身份验证已取消 [Play 游戏插件 DLL] 调试:在游戏线程上调用用户回调
有时它会抛出
[Play 游戏插件 DLL] 开始身份验证转换。操作:SIGN_IN 状态: ERROR_TIMEOUT
或
[Play 游戏插件 DLL] 开始身份验证转换。操作:SIGN_IN 状态: ERROR_NOT_AUTHORIZED
但仅此而已。最奇怪的是,它打开了 Google Play 游戏弹出窗口,它要求权限,我接受它,一切都按预期进行,但在应用程序中它永远不会成功。我已经在 Playfab 上注册了平台插件,在 google 开发者控制台上添加了一个链接的 web 应用程序,将客户端 oauth id 和 secret 复制到 playfab,配置了重定向的 uri 和端点链接(参考:https://www.youtube.com/watch?v=FIse9VOk-FE,https://api.playfab.com/docs/tutorials/landing-players/sign-in-with-google )。但是这些都不起作用,我无法对其进行身份验证,无论它是否通过 Playstore 安装,我唯一没有尝试过的是将它作为 Playstore 上的 alpha 版本进行测试,目前正在进行内部测试.
[更新 1:] 我在清醒时使用的代码:
PlayGamesClientConfiguration config = new
PlayGamesClientConfiguration.Builder()
.AddOauthScope("profile")
.WithInvitationDelegate(GoogleInvitation)
.WithMatchDelegate(GoogleMatch)
.RequestEmail()
.RequestServerAuthCode(false)
.RequestIdToken()
.Build();
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.Activate();
我用来登录的代码:
Social.localUser.Authenticate((success, message) =>
{
Debug.Log("Authentication Message: " + message);
if (success)
{
var serverAuthCode = PlayGamesPlatform.Instance.GetServerAuthCode();
_AuthService.AuthTicket = serverAuthCode;
_AuthService.Authenticate(Authtypes.Google);
}
else
{
Debug.Log("Failed authenticating with google");
}
});
【问题讨论】:
标签: android unity3d google-play google-play-services google-play-games