成就未显示在Google Play游戏应用中 [英] Achievements not showing in Google Play Games App

查看:384
本文介绍了成就未显示在Google Play游戏应用中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们根据Google的官方开发文档为Android游戏实现了Google Play成就,但是似乎有些失误,因为我们注意到Google Play游戏应用中存在以下奇怪行为:

We implemented the Google Play achievements for our Android game according to the official google development documentation, but there seems to be something off, as we notice the following strange behavior in the Google Play Games app:


  • 成就未显示在Google Play游戏应用中


  • 在Google Play游戏应用的游戏详细信息视图中,成就标签根本不会显示:

所获得的成就会像通过玩法互动获得的预期那样显示在游戏中的未锁定弹出窗口中,但仍然不会显示在Google Play游戏应用中。

The achievements show up as an unlocked popup in game like expected when they gained via gameplay interaction, but still they do not show up in the Google Play Games app.

我们了解到可能会有玩家的门槛需要显示它,但另一方面,我们看到下载次数少至100的游戏已经在Google Play游戏应用中具有成就计数器和徽章。

We read that there might be a threshold of players needed for it to show up, but on the other hand we saw games with as little as 100 downloads which already have the achievements counter and badge in the Google Play Games app. Is there any additional configuration or action needed from our side to have it displayed?

推荐答案

我们自己找到了答案。我们在 Google Play开发者控制台 Google API控制台中弄乱了配置。

We found the answer ourselves. We messed up the configuration in the Google Play Developer console and in the Google API console.

我们注意到我们的应用具有不同的OAuth2客户端ID,例如:

We noticed that our app had different OAuth2 Client IDs, e.g.:

Google Play开发者控制台,链接的应用程序详细信息视图

121212121212-4k97si3bnwertwertwet78oj571nl81ce3.apps.googleusercontent.com

121212121212-4k97si3bnwertwertwet78oj571nl81ce3.apps.googleusercontent.com

Google API控制台,凭据,OAuth 2.0客户端ID

121212121212-h25jh8qrps8awertwetertwetweagp3n3t .apps.googleusercontent.com

121212121212-h25jh8qrps8awertwetertwetweagp3n3t.apps.googleusercontent.com

我们还看到,我们从 Google Play游戏服务当我们查看 Google API控制台的控制台时。

We also saw that we had a lot of errors coming from the Google Play Games Services when we looked in the Dashboard of the Google API console.

仔细观察,我们发现几乎所有错误都是客户端错误(4xx),但我们找不到原因。

At a closer look, we saw that nearly all of them were client errors (4xx), but we couldn't find out why.

我认为在开发过程中的某个时刻,我们的签名证书的SHA1存在问题,并认为我们可以创建一个新的 OAuth2.0 客户端,可以在 Google API控制台中手动更新SHA1。

I think at some point during development, we had problems with the SHA1 of our signing certificate and thought, we could create a new OAuth2.0 client manually in the Google API console to update the SHA1.

根据此 Google Developers视频,其中说 OAuth2.0 客户端应在中创建Google Play开发者控制台,因为它将自动创建客户端ID并将其与成就排行榜。如果是在 Google API控制台中以其他方式创建的,则将没有链接,并且它将返回有效的登录名,但不知道哪个成就排行榜应该会使用并返回错误。

This is bad according to this Google Developers video which says that an OAuth2.0 client should be created in the Google Play Developer console, because it will automatically create the client ID and associate it with Achievements and Leaderboards. If it is created the other way around in the Google API console, there will be no linkage and it will return a valid login, but doesn't know which Achievements and Leaderboards should be used and will return errors.

Google Play开发者控制台中的链接应用在发布后无法再删除,因此我们对其进行了重命名以便将它们显示在链接的应用程序(zz-mygame)的底部,并且我们删除了我们在 Google中手动创建的 OAuth 2.0 客户端API控制台,因为它们始终无法与 Google Play服务一起使用。

As Linked Apps in the Google Play Developer console can no longer be deleted after they were published, we renamed them so that they would be listed at the bottom of the linked apps (zz-mygame) and we deleted the OAuth 2.0 clients we created manually in the Google API console as they were not working with the Google Play services anyway.

然后我们在 Google Play开发者控制台的游戏的游戏服务部分中创建了新的链接应用程序正确的SHA1,这会生成一个新的 OAuth 2.0 客户端,该客户端与 Play服务连接。然后,我们在凭据部分的 Google API控制台中进行了检查,发现添加了新的 OAuth 2.0 客户端,该客户端具有与 Google Play开发者控制台中游戏服务的链接应用程序部分中相同的ID(121212121212-34adfasdfsf34343422zzzz3433.apps.googleusercontent.com)。

We then created new linked apps in the Game services section of our game in the Google Play Developer Console, added the correct SHA1 and this generated a new OAuth 2.0 client which is connected with the Play services. We then checked this in the Google API console in the Credentials section and saw that a new OAuth 2.0 client was added and that this client had the same ID (121212121212-34adfasdfsf34343422zzzz3433.apps.googleusercontent.com) as in the linked apps section of the Game services in the Google Play Developer console.

完成这些更改后,Achievements正常运行,并且已经在与开发版本和能够测试 Google Play游戏服务访问权限的用户一起测试游戏,成就现在会显示在 Google Play游戏应用中,并带有一个自己的标签,列出所有成就。此外, Google API控制台中的错误不再发生。

After these changes, Achievements were working fine and already when were testing the game with dev builds and user who had testing access to the Google Play Game Services, the Achievements would now show up in the Google Play Games App and with an own tab listing all Achievements. Also the errors in the Google API console didn't occur any longer.

这篇关于成就未显示在Google Play游戏应用中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆