【发布时间】:2020-07-15 17:29:26
【问题描述】:
GPG 服务不工作
它显示原生 GPG 窗口,但当它关闭时,PlayGamesPlatform.Instance.Authenticate() 回调返回 NetworkError
在 Google Play 控制台中: 创建了“游戏服务”。
在“游戏详情”部分,添加了描述 512x512 和 1024x500 图标。
在“链接的应用程序”部分,添加了一个安卓应用程序并完成了身份验证(OAuth 2.0 密钥已自动创建)
在“成就”部分,创建带有描述和 512x512 图标的成就。
在“测试”部分添加了一个用于测试的 gmail 帐户
在“发布”部分,点击发布。
在 Google API 中:
已激活 Google Drive API 和 Google Play Android 开发者 API(无需创建任何密钥)
在 Android 的 OAuth 密钥和“发布管理”>“应用唱歌”>“应用签名证书”中检查了 SHA-1
在统一中:
从https://github.com/playgameservices/play-games-plugin-for-unity下载最新版本
In Window> Google Play 游戏> 设置> Android 设置,使用“获取资源”链接从 Google Play 控制台的“成就”部分复制 xml 格式文本,ClientID 格式为 123456789123456-ffffffffffffffffffffffff。 apps.googleusercontent.com
测试版本使用与发布在 Google Play 上的应用程序相同的密钥进行签名,并具有相同的公司名称和产品名称
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
.RequestIdToken()
.Build();
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.Activate();
PlayGamesPlatform.Instance.Authenticate(SignInInteractivity.CanPromptAlways, ((SignInStatus status) =>
{
if (status == SignInStatus.Success)
{
print( $"Welcome {PlayGamesPlatform.Instance.GetUserDisplayName()}\n");
}
else
{
print($"Fail:{status}");
}
}));
在 Unty 控制台中调试时我有
<i>AndroidPlayer(ADB@127.0.0.1:34999)</i> Returning an error code.
#0 0x443df5a (libunity.so) GetStacktrace(int) 0x25
#1 0x4e788b6 (libunity.so) DebugStringToFile(DebugStringToFileData const&) 0x169
#2 0x49875fe (libunity.so) DebugLogHandler::Internal_Log(LogType, LogOption, core::basic_string<char, core::StringStorageDefault<char> >, Object*) 0x65
#3 0x498754e (libunity.so) DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*) 0xb5
【问题讨论】:
标签: unity3d authentication google-oauth google-play-games