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 ;)

其他提示

This can also happen if gamekit is missing from Required device capabilities in your plist.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top