Game Center Leaderboard Doesn't Display Scores

Anybody have any help to offer? REALLY STUCK!

It would really help if your code was properly formatted.  It’s really hard to read when all lines are flush against the left edge.  See: https://coronalabs.com/blog/2015/06/09/tutorial-the-value-of-well-formatted-code/

Also, we don’t need to see your entire code either. We need to see where you’re initializing and logging into GameCenter and where you’re setting the score.

Is this a production app? or are you testing on a device? 

Does it say anything about *sandbox* anywhere?

What type of provisioning profile are you using?

Are you using your regular gameCenter account or a testing account?

Are you getting any errors or relevant messages in your device’s console log?

@Rob 

Thanks for your response!

This is an app that is currently on the iOS App Store. I have turned *sandbox* on.  When I launch the app it says my Game Center username and it says that I am signed in. Below my username it says **sandbox**.  I am using my app store distribution provision file.  I am using my regular Game Center.  I will check for errors in my device console when I get home.  However, it seems as GC is working fine up until I click the leaderboard and it says “no scores”. Thanks!

-Max

Hi Max,

One thing I’ve seen in the past… time and time again… is that developers attempt to submit “high scores” to GC without having properly set up what a “high score” actually is within iTunes Connect. In other words, they keep trying to submit high scores, but those scores are not actually “higher” than any previous score submitted, so GC simply tosses it out and ignores the call. Then the developer goes in circles trying to figure out why, but at the core, it’s that they simply did not submit a higher score, so nothing happens… in these cases, it has absolutely nothing to do with their code (in Corona), but simply that they didn’t not properly configure the leaderboard properly in iTunes Connect.

Now, this might not be your issue, but please check that carefully, because I’ve seen it happen over and over in the past to other developers, and simply fixing that makes everything work as expected. Remember to carefully check the leaderboard setup, including the sorting order (low to high, or high to low), etc.

Also remember that scores can take some time to get updated to GC. It doesn’t necessarily happen instantaneously.

Take care,

Brent

@brent 

Sadly all is setup… 

Below is an image of my iTunes connect GC area. 

If you are using a version of your app signed with a distribution for the store profile, it will not talk to the sandbox. That’s only for development profiles.

You need to go to the GameCenter app and logout of your test account, then run your app, login with an AppleID that you use in production and see if things work for you.

Rob

@rob

Did everything you said and still no scores… any other advice?

Did you ever have it working with the Sandbox?

@rob

Yes! it was working perfectly in sandbox before it wen’t live! Now it won’t display scores…

Hi Max,

In your code on the following line (line 195 in the forum post but doubtfully 195 in your actual code), please run about 5-10 tests using actual integer numbers in place of the “highScore” variable. I need to ensure that this isn’t somehow an issue that your code doesn’t know what “highScore” actually is and thus is submitting nil to GC.

[lua]

    localPlayerScore = { category = “spin.leaderboard”, value = highScore },

[/lua]

So, run a few tests using numbers like 10, 50, 100, 1000, 10000, etc. for the “value” key.

Brent

@brett

I tested it 8 times with all the numbers you said.  Still no scores.  Any ideas?

Hi Max,

Is the app even reaching that point in the code? Does the call even get made to “gameNetwork.request( “setHighScore”, … )”? Also, please go create a new leaderboard and eliminate the previous one (start fresh).

Brent

The code is incredibly hard to read since there are no indents, and there is a lot of unrelated code, but no where do I see “loggedIntoGC” defined or set to true anywhere, so I would guess that the code after line 191 is not be executed.