I'm trying to implement GameCenter to my app. This is to show me the GameCenter LeaderBoard but it's shows me: No Items.
-(IBAction) ShowLeader{
GKGameCenterViewController* gameCenterController = [[GKGameCenterViewController alloc] init];
gameCenterController.viewState = GKGameCenterViewControllerStateLeaderboards;
gameCenterController.gameCenterDelegate = self;
[self presentViewController:gameCenterController animated:YES completion:nil];
}
The user is authenticate and that's show up when i connect.
when i report score in my GameViewController:
if ([GKLocalPlayer localPlayer].isAuthenticated) {
GKScore* scoreReporter = [[GKScore alloc] initWithLeaderboardIdentifier:@"GameHighScore"];
scoreReporter.value = HighScoreNbr;
scoreReporter.context = 0;
// NSArray *scores = @[scoreReporter];
[GKScore reportScores:@[scoreReporter] withCompletionHandler:^(NSError *error) {
if (error) {
NSLog(@"error: %@", error);
}
printf("no error: ");
}];
}
This shows me no error so i suppose it works.
I already tried with 2 accounts since i saw that on other answer but didn't help.
If you need any more info please comment.
Thanks.
I found out myself after reading and viewing tones of video.
if that can help someone who as the same problem:
you need to had your BundleID from Itunes connect to your xcode5 info playlist. then it should work.
Hope it helps ;)