Yo_Its_Az
Yo_Its_Az

Reputation: 2073

Adding score to Game Center working on simulator, not on device

I am adding Game Center functionality to my app. On the simulator, the app registers and loads the high scores perfectly from the Game Center app and the Leaderboard View in my app. When I try the same thing from an actual device,the console says the score was submitted but the score does not show up in the Game Center App or in the Leaderboard View in my app. No idea why this would be. Any Help would be great. Here is my code on how I am implementing this.

My View Did Load

[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error){
        if (error ==nil) {
            NSLog(@"Success");
        } else {
            NSLog(@"Fail");
        }

    }];

How I am submitting my score

-(IBAction)submitMyScore{
    //This is the same category id you set in your itunes connect GameCenter LeaderBoard
    GKScore *myScoreValue = [[[GKScore alloc] initWithCategory:@"01"] autorelease];
    myScoreValue.value = score;

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

    }];
}

Anyone have any idea why this is?

Upvotes: 2

Views: 2206

Answers (1)

Yo_Its_Az
Yo_Its_Az

Reputation: 2073

I fixed the Issue. I logged out of my game center account and then started the game. It prompted me to create a new game center account and I did. It then put me into sandbox mode and allowed me to view and post scores.

Upvotes: 2

Related Questions