2

I have integrated Game Center in my project, i can log in to game center and can open leadersboard but its not showing any scores . i have tried to submit score in leaderboard and it returns success but its not showing in there.

Submitting score

-(void)submitScore
{
    GKScore *myScoreValue = [[[GKScore alloc] initWithCategory:@"something"] autorelease];
    myScoreValue.value = [prefs integerForKey:@"total"];

    [myScoreValue reportScoreWithCompletionHandler:^(NSError *error){
        if(error != nil){
            NSLog(@"Score Submission Failed");
        } else {
            NSLog(@"Score Submitted");
        } 
    }];
}

I have searched on this issue and i found this and this I have tried both but not working.

I am getting this on starting app.

<Info>: 16:39:10.550238 com.apple.AVConference: GKSConnSettings: set server: {
    "gk-cdx" = "17.173.254.218:4398";
    "gk-commnat-cohort" = "17.173.254.220:16386";
    "gk-commnat-main0" = "17.173.254.219:16384";
    "gk-commnat-main1" = "17.173.254.219:16385";
}

Is there anything wrong with me code?

Community
  • 1
  • 1
Zohaib
  • 2,845
  • 2
  • 23
  • 33

1 Answers1

1

Some notes for you

« Make sure leaderboard is setup in iTunesConnect with Id: something

« Login gamecenter app with testUser from same iTunesConnect account

« Try myScoreValue.value = 500 once, sometimes small values are neglected in sandbox mode.

« Confirm - Logged in to sandbox mode

enter image description here

Guru
  • 21,652
  • 10
  • 63
  • 102
  • I have setup id something in iTunes Connect and my values are always greater than 500. sometimes 30k.I have login from different account than apple account from which i have created app in iTunes Connect. does it matters. because in game center you can sign in from any id and submit your score – Zohaib Apr 16 '13 at 07:43
  • make sure you are on sandbox mode in Game Center – Guru Apr 16 '13 at 07:58
  • Yeah i m on the sandbox. Thanks for your answer. its working now. there was a space after ID and i couldnt see that. removed that space and its working now. – Zohaib Apr 16 '13 at 08:04
  • 1
    Check the sort order of the leaderboard in iTC. Most common cause is that it's set wrong, so the "better" score isn't getting replaced. – geowar Apr 17 '13 at 01:22