简体   繁体   中英

Android Google Play Games Services

Trying to integrate google play games leaderboard in an android application.

Google API client get connected successfully. I am getting result code as -1 which is nothing but 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. Even though before calling the intent i am checking is the google api client is connected or not. Which returns true each and every time.

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.

The GoogleApiClient is in an inconsistent state and must reconnect to the service to resolve the issue. 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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