c# – Google Play游戏服务:ERROR_NOT_AUTHORIZED,推出Beta时. [Unity3d] [GooglePlayGamServices]
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了c# – Google Play游戏服务:ERROR_NOT_AUTHORIZED,推出Beta时. [Unity3d] [GooglePlayGamServices],小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3916字,纯文字阅读大概需要6分钟。
内容图文
Google Play游戏服务:SIGN_IN状态:ERROR_NOT_AUTHORIZED,在推出Beta版时.
还有: –
W Auth : [GetToken] GetToken failed with status code: UNREGISTERED_ON_API_CONSOLE
E TokenRequestor: You have wrong OAuth2 related configurations, please check. Detailed error: UNREGISTERED_ON_API_CONSOLE
如果我直接从Unity构建和运行,一切正常.
但是,当我推出测试版时,它会显示带有加载圈的登录谷歌绿色框(然后是帐户 – >选择测试版测试人员电子邮件),然后什么都没有.
使用: –
> GooglePlayGamesPlugin-0.9.38a
>团结5.6.03
> sdk组件更新了rev 40,rev 51
我做的事情: –
>创建了一个新的应用程序谷歌播放控制台
>添加apk,制作测试版,然后制作推出.
>后来我在新的更新中添加了游戏服务,推出了测试版.
> note – 所有apk,rollout使用相同的密钥库和包名称.
> Google Play控制台 – >发布管理 – >应用签名:上传
证书SHA1与Google API相同 – >项目 – >客户端ID
Android SHA1
玩游戏设置: –
> Beta测试仪电子邮件:打开
>游戏保存数据:关闭
>测试电子邮件:添加电子邮件
>测试Alpha和Beta:都勾选(绿色)
以下日志:
05-23 12:55:44.400 28917 29002 I GamesNativeSDK: Auth operation started: SIGN IN
05-23 12:55:44.400 28917 29002 I GamesNativeSDK: Connecting to Google Play...
05-23 12:55:44.522 28917 28948 W Unity : !!! [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 WARNING: Creating new PlayGamesPlatform
05-23 12:55:44.522 28917 28948 W Unity :
05-23 12:55:44.522 28917 28948 W Unity : (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
05-23 12:55:44.522 28917 28948 W Unity :
05-23 12:55:44.522 28917 28948 I Unity : [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 DEBUG: Activating PlayGamesPlatform.
05-23 12:55:44.523 28917 28948 I Unity : [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 DEBUG: PlayGamesPlatform activated: GooglePlayGames.PlayGamesPlatform
05-23 12:55:44.523 28917 28948 I Unity : [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 DEBUG: Creating platform-specific Play Games client.
05-23 12:55:44.523 28917 28948 I Unity : [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 DEBUG: Creating Android IPlayGamesClient Client
05-23 12:55:44.523 28917 28948 I Unity : [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 DEBUG: Starting Auth Transition. Op: SIGN_IN status: ERROR_NOT_AUTHORIZED
05-23 12:55:44.523 28917 28948 I Unity : [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 DEBUG: Invoking callbacks, AuthState changed from silentPending to Unauthenticated.
05-23 12:55:44.523 28917 28948 I Unity : [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 DEBUG: there are pending auth callbacks - starting AuthUI
C#代码:
using UnityEngine;
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine.SocialPlatforms;
public class PlayGameManger : MonoBehaviour {
public static PlayGameManger Instance{ set; get;}
public bool isLogedIn;
void Awake () {
if (Instance == null) {
Instance = this;
isLogedIn = false;
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder ().Build();
PlayGamesPlatform.InitializeInstance (config);
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.Activate ();
SignIn ();
DontDestroyOnLoad (gameObject);
} else {
Destroy (gameObject);
}
}
public void SignIn(){
if (isLogedIn == false) {
Social.localUser.Authenticate (success => {
isLogedIn = success;
//Debug.Log("Signin : "+success);
});
}
}
// Achievements and other code here
}
救命,
谢谢 :)
解决方法:
现在一切正常.
由于启用了Google App Signing,它无法正常工作,我想我们必须对AndroidManifest.xml进行一些更改才能让Google Play游戏服务工作
见这里: – https://support.google.com/googleplay/android-developer/answer/7384423
但下面给出的解决方案也可以.
[解决了]
我做了什么 :-
> Google Play控制台 – >选择您的应用 – >发布管理 – >应用签名 – >应用签名证书:复制SHA-1(不要复制’SHA1:’字样)
>打开https://console.developers.google.com/,选择您的项目 – >凭证 – > OAuth 2.0客户端ID – >修改OAuth客户端 – >签名证书指纹 – >用复制的SHA1替换旧的SHA1 – >保存.
>打开你的游戏,你应该登录 – >电子邮件选择 – >选择测试人员电子邮件Google Play游戏服务应该可以正常使用.
内容总结
以上是互联网集市为您收集整理的c# – Google Play游戏服务:ERROR_NOT_AUTHORIZED,推出Beta时. [Unity3d] [GooglePlayGamServices]全部内容,希望文章能够帮你解决c# – Google Play游戏服务:ERROR_NOT_AUTHORIZED,推出Beta时. [Unity3d] [GooglePlayGamServices]所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。