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.
hope this may help you in solving your problem:
https://code.tutsplus.com/tutorials/google-play-game-services-leaderboards--cms-20700
These links will help u in, Overview : https://code.tutsplus.com/tutorials/google-play-game-services-achievements--cms-20591 . Integration : https://code.tutsplus.com/tutorials/integrating-google-play-services-on-android--cms-19828 . If you are not satisfied refer this link, https://coronalabs.com/blog/2013/06/25/tutorial-introducing-google-play-game-services/
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.