Google Play Services签名在Unity Android上不正常
我正在尝试在我的Unity Android项目中添加Google Play服务。 我已经在项目中实现了Google Play服务插件。填写所有的信条。我在开发人员控制台上有2个不同的内部测试帐户。
这是我的问题:
- 帐户答:Signinstatus成功,没有显示欢迎的弹出窗口 信息。
- 帐户B:SignInstatus已取消而不是登录。
是因为内部测试还是其他?
UNITY版本:2019.4.16F1
GPGS插件Verison:0.11.01
using GooglePlayGames;
private bool Authenticated;
public void Start() {
PlayGamesPlatform.Instance.Authenticate(ProcessAuthentication);
}
internal void ProcessAuthentication(SignInStatus status) {
if (status == SignInStatus.Success) {
// Continue with Play Games Services
Authenticated = true;
} else {
// Disable your integration with Play Games Services or show a login button
// to ask users to sign-in. Clicking it should call
// PlayGamesPlatform.Instance.ManuallyAuthenticate(ProcessAuthentication).
Authenticated = false;
}
}
I'm trying to add Google Play Services on my Unity Android project.
I've got already implement google play services plugin to my project. Filling the all crediantials. I've got 2 different internal test accounts on developer console.
Here is my question:
- Account A: SignInStatus Success and not showing welcome pop-up
message. - Account B: SignInStatus Canceled and not sign in.
Is it because internal test or something?
unity version: 2019.4.16f1
gpgs plugin verison: 0.11.01
Here is my code:
referanced: https://github.com/playgameservices/play-games-plugin-for-unity
using GooglePlayGames;
private bool Authenticated;
public void Start() {
PlayGamesPlatform.Instance.Authenticate(ProcessAuthentication);
}
internal void ProcessAuthentication(SignInStatus status) {
if (status == SignInStatus.Success) {
// Continue with Play Games Services
Authenticated = true;
} else {
// Disable your integration with Play Games Services or show a login button
// to ask users to sign-in. Clicking it should call
// PlayGamesPlatform.Instance.ManuallyAuthenticate(ProcessAuthentication).
Authenticated = false;
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的代码没有错。
我刚刚创建了一个新项目,获得了一个新的SHA-1,将我的帐户添加到了新的Google Play游戏机中,并验证了所有内容已成功测试。
在此过程中,我们发现了以下问题:
如果您使用的是11.01版本,请通过遵循以下步骤检查是否存在问题。
按照以下步骤检查。
(资产→外部依赖管理器→Android解析器→强制解析)
Assets/googleplaygames/com.google.glay.play.games/editor/google playplaygamesplaygamespluginependencies.xml:11:repo path'packages'packages/com。 Google.play.games/Editor/M2Repository'不存在。
如果发生上述错误,则可以通过选择两个解决方案之一来解决它。
首先,请参见 @greg-hanes 在这里 。
具体方法是在资产/googleplaygames/com.google.play.play.games/editor/editor/m2repository文件夹中创建Google PlayGamesplugIndipendencies.xml文件,并粘贴以下内容。
然后强迫再次解决。
( gradle在途中未能获取依赖项。如果遇到错误,请确保正确设置了JDK路径。)
第二,将版本降级到版本10.14。
这是我写的代码,我只在运行时运行一次。当我运行它时,它成功起作用。
您可以通过安装Android LogCat软件包检查Android上的日志。
我讨厌11.01版本,所以我正在使用10.14版本:)
希望您的问题解决了!
There is nothing wrong with your code.
I just created a new project, got a new SHA-1, added my account to the new google play console and verified that everything was tested successfully.
In doing so, we found the following problems:
If you are using the 11.01 version, please check if there is a problem by following the procedure below.
Follow the steps below to check.
(Assets → External Dependency Manager → Android Resolver → Force Resolve)
Assets/GooglePlayGames/com.google.play.games/Editor/GooglePlayGamesPluginDependencies.xml:11: Repo path 'Packages/com.google.play.games/Editor/m2repository' does not exist.
If the above error occurs, you can solve it by choosing one of two solutions.
First, see comments by @greg-hanes here.
The specific method is to create a GooglePlayGamesPluginDependencies.xml file inside the Assets/GooglePlayGames/com.google.play.games/Editor/m2repository folder and paste the following contents.
And then Force Resolve again.
(Gradle failed to fetch dependencies on the way. If you get an error, make sure your JDK path is set correctly.)
Second, downgrade the version to version 10.14.
Here is my code that I wrote to run only once at runtime. It works successfully when I run it.
You can check the logs on Android by installing the Android Logcat package.
I hate the 11.01 version so I'm using the 10.14 version :)
Hope your problem is solved!