I implement Google Game Service for Android (Cocos2d-x) with Cocos Helper of Sonar System Team.
Everything is OK:
- Sign-In Google Game Service.
- Show Achievement and increateAchievement very good.
- The first time, I sign-in to Google Game Service ==> show leaderboard is OK.
However, I submit score to leaderboard then re-show leaderboard again it always close automatic and I get respondCode=RESULT_RECONNECT_REQUIRED
.
Can you give me some suggestion to fix it ?
I've found answer:
Reason of issue is OAuth2 Client ID form Game Services Console ==> ==> Link apps didn't equal with OAuth2 Client ID, be created at API Manager:
So to fix that, you must create new Link Apps in Google Service Console.
==> That will fix on server and leaderboard will working OK .
In my case, I had two OAuth2 clients configured: one associated with the development certificate SHA fingerprint (keytool -exportcert -keystore ~/.android/debug.keystore -list -v) and one associated with the release certificate SHA fingerprint (keytool -exportcert -keystore path/to/your/release.keystore -list -v).
While debugging, the apk was signed with the development certificate, and after submitting a score to the leaderboard, the next time I opened the leader board, it closed automatically without showing the leaderboard or an error message. After this, the only way to be able to use the leader board again, was uninstalling the tested app and the Google Play Games app from the device.
To be able to separate the development and release Google Play Services OAuth2 configuration, you can have two google-services.json files: one on the src/debug folder and another on the src/release folder.
When I used an apk was signed with the release certificate, the leaderboard worked properly before and after submitting scores to the leaderboard.
My conclusion: to be able to test the leaderboard you must use an apk signed with a release certificate.