0

I'm developing for iOS 6.0 and submitting scores to Game Center. Everything works fine when I submit a score with an internet connection.

When I turn off my internet connection and submit a score that should update the leaderboard, the completion handler is invoked without any error. When I turn the internet connection back on, I'm expecting GameKit to forward the score to Game Center and for the leaderboard to be updated. But it doesn't update, not even after a long while (1+ hour).

The player is authenticated when the score is initially submitted and again when the internet connection is turned back on.

Am I missing something? Does it work for sandbox accounts? My score submission code is below:

- (void)submitScore:(int64_t)score category:(NSString*)category {

//1: Check if Game Center features are enabled

if (!_gcEnabled) {
    return;
}

//2: Create a GKScore object

GKScore* gkScore = [[GKScore alloc] initWithCategory:category];

//3: Set the score value

gkScore.value = score;

//4: Send the score to Game Center

[gkScore reportScoreWithCompletionHandler:^(NSError* error) {

    [self setLastError:error];

    BOOL success = (error == nil);

    if ([_delegate respondsToSelector:@selector(onScoresSubmitted:)]) {

        [_delegate onScoresSubmitted:success];
    }
}];

}

4

1 回答 1

1

似乎缓存的分数,即在没有互联网连接时提交给游戏中心的分数,在互联网连接恢复时不会自动或立即发送到游戏中心。相反,它们会在下次报告分数时发送。

似乎如果我已经缓存了排行榜类别 x 的分数,我必须提交一个特定于该类别的新分数。提交不同类别的分数不会清空类别 x 的缓存。

于 2013-09-07T00:25:22.880 回答