Adding Leaderboards to Submit and Compare Scores

Hi guyz! I have an application ID for my Google Play Game Services following the instructions provided here:
https://developers.google.com/games/services/console/enabling#b_create_a_client_id

let’s say it’s:
Application ID: 12345789

What’s next to do inorder to be able to submit and compare scores ??? Is the Application ID the Client ID??? this is my first time so please be clear on your instructions. thankx! :smiley:

here try it out:

https://play.google.com/store/apps/details?id=com.juandergames.theadventuresofdumdum_firstflight&hl=en

1 Like

Application ID is used for manifest.xml to make apk file.
Use client id to submit score.

And you don’t have to compare score to update high score on leaderboard.
Google compares it and update when last submitted score is better.

But if you need to get current score on leaderboard,
use getGamesClient().loadPlayerCenteredScores()

You can get current user centered list of leaderboard.

api description is here https://developer.android.com/reference/com/google/android/gms/games/leaderboard/Leaderboards.html

But there is some bug of this api.
Note this https://code.google.com/p/play-games-platform/issues/detail?id=13&colspec=ID%20Type%20Status%20Priority%20Platform%20Summary%20Stars

1 Like

hi @hzlov, are you successful in integrating leaderboard in your app?? if so, can you share how you do it :))

i am currently using Carlos Pinan’s sample from github and so far im successful in iOS, but the problem is when i move to Eclipse! :smile:

I was done with https://github.com/playgameservices/android-basic-samples this example code from google.
But now I’m using C++ SDK for my project.

ahh, good for you. . what is C++ SDK, is that Marmalade? and, is it better than COCOS2d-X

C++ SDK is implemented by Google and you can download here.
https://developers.google.com/games/services/downloads/

It implemented much more than Carlos Pinan’s one.
And you don’t have to deal with native code (java, objective-c) expect for setting environment for both android & ios platform.

1 Like

@hzlov

are you free now? i actually have app ID and clienet ID, and if your C++ SDK is easy, can u guide me??

I dont know how to apply/use Carlos Pinan’s project to my own project. . .i have lots of errors,. i dont even knw what version his sample uses

I did it with https://developers.google.com/games/services/cpp/GettingStartedNativeClient document.
And https://github.com/playgameservices/cpp-android-basic-samples this samples.

Sorry, i’m middle of something.

1 Like

good for you, how bout Carlos Pinan’s work? did u manage to make it work?

I didn’t even know that before you’d mentioned it.
But I think, you better change sdk to Google’s C++ SDK instead of Carlos Pinnan’s.

i dont know how to use C++ SDK, i know a bit C++, i dont know Obj-C hahaha

It may take some days but this sample codes will help you a lot.

1 Like

Please be aware that Apple is rejecting apps with the Google Play Game Services. This is because it launches mobile Safari to get the user to login, which supposedly breaks their UI guidelines.

https://code.google.com/p/play-games-platform/issues/detail?id=133

@kidproquo

aw that sux!!! can you make Carlos’ Pinans “googleplaygameservices” sample working on android? i can only make it work with iOS

@kidproquo

It may depend on who reviews and what app looks like.
My app is launched about two month ago with Google Games sign-in that requires to switch to mobile safari to sign-in.
Something may be different thing of my app than others is,
my app just runs game without sign-in.
But user can sign-in at option menu if they want.

@reyanthonyrenacia

is Carlos Pinan’s api runs with webview on ios to sign-in Google Games?

@hzlov
I am worried about this since I want to have a common leaderboard for both iOS and Android. Looking at the linked issue, people are getting their apps rejected just for opening Safari for login. They do close Safari and send the user back to the app once the login completes. Are you doing anything different?

@kidproquo

The app I mentioned above uses just Google sign-in and save AppState.
That’s all.

Now I’m working new project which requires sign-in, leaderboard, achievement, quest with Google Game Service.
And for this project which using C++ SDK for Google Games,
I couldn’t find work around.

I’d been aware the issue you mentioned when I was integrating google games.
But my priority is publishing to android and I found google knew that issue.
So, I decided to wait for next C++ SDK update.

I’d done for both iOS and Android and checked working great for authorization, leaderboard, quest, achievements.
Just waiting for next update for iOS.

@hzlov
Thanks for the tips. Could you please write up a small tutorial on using the C++ SDK with cocos2d-x?