WOW! Steps to set a simple leaderboard in Google Play Services console!

Hello guys,

I have a general question about setting up Google Play Services so I can set up a simple leaderboard for one my upcoming app. I found this great tutorial

http://coronalabs.com/blog/2013/06/25/tutorial-introducing-google-play-game-services/

Which has this scary looking link with TONS of steps to get a simple leaderboard going.

Do I really need to go thru all these to setup my leaderboard? I do not even need achievements.

I hope not! I thought GameCenter was hard but this has to be the most complex services have seen or maybe I am simply use to GameCenter too much :slight_smile:

Thanks for any input.

Mo

And I thought I must be the only one in the whole wide world to feel this way… only yesterday I was going through the same questions… And today is day 2…

A wise person told me if you don’t want to use Achievements thats fine. Just set 5 of them to tick the box and forget about them. 

Thanks @ksan. LOL! Yes it seems to be a process from hell! So you confirm that list of steps is really the way to go :frowning:

I think I will go slow on this one. Thank you for the achievements tip! I may use them after all:) Still I would love to hear also from people who went thru hellish list of steps :slight_smile: So we can avoid some common issues that may arise.

Good luck and please share any tips if any. I will do the same.

Thank you again.

Mo

Got my Android 2.2 device soft-bricked trying to upgrade it to 2.3… Read that GPGS on 2.2 is not optimal so I thought I should go 2.3 and now I’m wasting time trying to recover this POS… It being my only Android device and me being not in a mood to buy any new devices put me in a predicament… So tip #1… read the instructions and follow them to the letter while in Android land. It is treacherous! 

WOW! That’s does not sound good. I have a feeling that too will suffer since I do not even have an Android device to test. I do have a new Kindle Fire HD but not sure that would work with GPGS. I will assume not.

Man, good luck!

Mo

From what I read I think you can test GPGS on Kindle Fire HD. Might be wrong of course but I think I saw something to that end. 

Thanks for your kind thoughts. Fish out of water is how I feel right now. Good luck as you tread through those steps. Do you have ADT (Android Developer Tools) installed on your Mac/PC? 

Cool! Yes I know how you feel! No, but I should install ADT on my Macbook. Just starting with Android side of things so I need to get setup. I released an app on Android/Amazon that was not too bad but this GPGS is going to take a while. Still, other did it so can we :slight_smile: (trying to cheer myself…) 

Cheers.

Mo

Ok. POS phone un-bricked and successfully upgraded to Android 2.3.5 and app still behaving the same way. So back to square one… Re-reading all the instructions and processing once again. Am I really this slow? :frowning:

LOL! No I am afraid that those instructions make GC integration a child play. I am working on something else right but soon I will need to go thru that list and start calling for my mommy :slight_smile:

Good luck and keep us posted on your “great” adventure!

Mo 

A trip to shops, a new Nexus 7 later I was still nowhere further. Thanks to some great friendly advice I ran through the whole sequence and now I have an operational leaderboard!!! Yayy. Pay attention to the steps around creating the client and the SHA1 creation from your keystore etc. Good luck. 

Yaaaaa! Good for you! I am too chicken to start :slight_smile: I will do it when I had bunch of wine…how long did it took you? Great job! Mo

How long did it take… Not that long, each time. I ended up doing it 3 times altogether. First the attempt with debug SHA1, second one worked but I didn’t like the way it looked so had to nuke it and start over and third time’s a charm. Altogether less than an hour I’d say not including the time to read and research. You’ll be fine.

LOL! The more I read the instructions the more I get affraid! But I think it will be ok. I just need sometime. I may also have couple questions after reading those instructions. Just things that are little confusing at first. I will post them when I get there. Thank you Ksan. Mo

Here’s a module I made that handles logging in, posting to a leaderboard, and earning achievements. It works for both Game Center and Google Play, assuming that both have the same Leaderboard ID and Achievement IDs (Apple let’s you set these, so just copy the Google Play IDs).

This file assumes you’ve created the leaderboards/achievements in Google Play, and have set up your build.settings file accordingly.

local gameNetwork = require("gameNetwork") local this = {} local function gameNetworkListener(event) local targetAppStore = system.getInfo("targetAppStore") if event.data and targetAppStore == "apple" then this.isLoggedIn = true elseif targetAppStore ~= "apple" and not event.isError then local type = event.type if type == "init" then this.hasInitialized = true gameNetwork.request("login", {userInitiated = true, listener = gameNetworkListener}) elseif type == "login" then this.isLoggedIn = true end end end function this.checkAchievements(value, type) if type == "score" then if value == 500 then gameNetwork.request("unlockAchievement", {achievement = {identifier = this.achievement1, showsCompletionBanner = true}}) end end end function this.login() if system.getInfo("targetAppStore") == "apple" then gameNetwork.init("gamecenter", gameNetworkListener) elseif not this.hasInitialized then gameNetwork.init("google", gameNetworkListener) else gameNetwork.request("login", {userInitiated = true, listener = gameNetworkListener}) end end function this.initialize() this.login() this.category = "Leaderboard ID" -- Replace this this.achievement1 = "Achievement ID" -- Replace this end function this.updateHighscore(score) gameNetwork.request("setHighScore", {localPlayerScore = {category = this.category, value = score}}) end return this

Whenever my game starts, I simply require the file and call initialize(). It will prompt the user if necessary, or automatically log them in if they have done so previously.

Also, before I post a score or check for an achievement, I make sure that isLoggedIn = true. If not, call login().

 if gameNetwork.isLoggedIn then -- Post a score, etc. else gameNetwork.login() end

Hopefully this will help you. :stuck_out_tongue:

I use this in my game, Echo Evasion. Check it out! http://www.slatebit.com/echoevasion

Mo, will do. Just shout out. I’m not an expert by any means but having gone through it just recently I might be able to recall something that might help. Good luck! 

@lKinx, thanks for your awesome sharing! This looks like a great module to serve this need.

LOL, THANKS I will try to start the process as soon as possible so it will be vivid in your mind (if I had went thru that horror, I will never forgotten it :slight_smile:

@IKinx: WOW, superb share!  Even better your app seems to show GC login on my iphone 5 (ios 7+) which with the code I am using would always tells that the user is not log in but it won’t show me the login menu. I will try your code and see. Thank you for sharing this. Especially since it seems to work both on Android/iphone!

I quickly checked out your game (and I will leave a review both on amazon and ios…sorry no pure android device) and I am amazed how beautiful it is! Not sure if you are open the suggestions here some. I hope it is ok :slight_smile:

1- You really need to choose the first screenshot carefully. The menu screen is never a good choice since it is not telling anything. On the iphone, that’s the only chance you have to impress. You have a good looking app and you should show it. I will suggest a screenshot with the obstacles showing like when you actually run the game. Also make the screenshot lighter. I know that the theme is a dark cave but for screenshots I think you need to people to see what is going on. I would also explain (banners) what the game is about or its main points. Simply having a normal screenshots does not help sell the game. Menu or about screenshots are not the way to go.

2- I will suggest to bring the main character to the center of the screen (or better maybe a little out center to the left) Currently it is really hard to play the game since your hand hides the hero most of the time. So having the hero totally on the left of the screen is not ideal to me.

3- I will make the game over menu box (and buttons) MUCH bigger. I had hard time clicking on play again button because it is so small on the iphone 5.

4- I do not know how you feel about re-skin but I will STRONGLY suggest you make a re-skin with “flappy bird” type gameplay. Please note, I am not saying to make a bird game but use the same beautiful graphics but make the gameplay the same a flappy bird (so the little guy jump up when you tap and had to go between obstacles…almost of what you have already) Why make a remake?

a- Because of the craziness over Flappy Bird, you probably going to get more DL and more exposure.

b- Your version will be the best looking flappy bird type out there. Just look around and you will see what I mean :slight_smile:

PLEASE take these suggestions with a big grain of salt and THANK YOU for you nice code share. I appreciate it!

Mo

Hello, 

I am having difficulty in getting the SHA1 fingerprint of the certificate. I am following instructions on (https://developers.google.com/games/services/console/enabling) but I am still not being able to get the “c” part (in the link) done i.e, to get the release certificate fingerprint and to get the debug certificate fingerprint. 

Thanks

Are you on a Mac or PC? Do you have the ADT Kit installed on your computer?

I’m using a Mac… And I haven’t installed the ADT kit yet.

Ok. Suggest installing ADT as it gives you the Debug SHA in a Prefs screen. 

Did you try the Keytool and have trouble with it? Please review this Corona doc which I found quite useful : 

http://docs.coronalabs.com/guide/distribution/androidBuild/index.html