简体   繁体   English

Android Google Play游戏服务

[英]Android Google Play Games Services

Trying to integrate google play games leaderboard in an android application. 尝试将Google Play游戏排行榜集成到Android应用程序中。

Google API client get connected successfully. Google API客户端已成功建立连接。 I am getting result code as -1 which is nothing but RESULT_OK. 我得到的结果代码为-1,这不过是RESULT_OK。

But when I call google leaderboard api using leaderboard intent in my on activity result I get 10001 which stands for inconsistent state which is RESULT_RECONNECT_REQUIRED. 但是,当我在活动结果中使用排行榜意图调用Google排行榜api时,会得到10001,代表状态不一致,即RESULT_RECONNECT_REQUIRED。 Even though before calling the intent i am checking is the google api client is connected or not. 即使在调用意图之前,我正在检查的是Google API客户端是否已连接。 Which returns true each and every time. 每次都返回true。

Not able to understand what might be causing this issue. 无法了解可能导致此问题的原因。

According to the documentation , RESULT_RECONNECT_REQUIRED is sent back to the calling Activity when a reconnect is required. 根据文档 ,当需要重新连接时,RESULT_RECONNECT_REQUIRED将发送回调用方活动。

The GoogleApiClient is in an inconsistent state and must reconnect to the service to resolve the issue. GoogleApiClient处于不一致状态,必须重新连接到服务才能解决问题。 Further calls to the service using the current connection are unlikely to succeed. 使用当前连接对服务的进一步调用不太可能成功。

To handle it call googleApiClient.reconnect() and onConnected() will be called when the client is connected again. 要进行处理,请在再次连接客户端时调用googleApiClient.reconnect()和onConnected()。

The reason you might get that code is because app is not linked. 之所以会得到该代码,是因为应用未链接。 So on play games developer console linked my application and it started to work. 因此,在进行游戏时,开发人员控制台将我的应用程序链接了起来,并且开始起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM