iOS Game Center: Scores not showing on leaderboard in sandbox

纵然是瞬间 提交于 2019-11-26 10:46:54

问题


I\'m developing a Game Center enabled game and I\'m running into an issue in the sandbox environment. I can successfully report the score without error. However, when I show the leaderboard, there are no scores visible. To verify that the score actually got there, I query the local user\'s score with the following code:

-(void)retrieveLocalScoreForCategory:(NSString *)category
{
    GKLeaderboard *leaderboardRequest = [[GKLeaderboard alloc] init];
    leaderboardRequest.category = category;

    [leaderboardRequest loadScoresWithCompletionHandler: ^(NSArray *scores,NSError *error) 
     {
         [self callDelegateOnMainThread: @selector(localPlayerScore:error:) withArg: leaderboardRequest.localPlayerScore error: error];
     }];
}

In my delegate I log the score to the console and I can see the correct score got there. I have already verified that I\'m showing the leaderboard using the correct leaderboard category id (I only have one).

Does anyone know why my score isn\'t visible on the leaderboard in the sandbox environment immediately? Is there a delay before the score shows up?


回答1:


I ran into the same issue with projects I've worked on.

The GC Leaderboards (Sandbox/live) will only return scores if there are two or more players on the Leaderboards.

So make sure you either submit the score with 2 different accounts on one 1 device or 2 different accounts on separate devices.




回答2:


Try changing timeScope.

Sometimes GKLeaderboardTimeScopeAllTime & GKLeaderboardTimeScopeToday returns nothing but GKLeaderboardTimeScopeWeek works fine. I think it's a GC sandbox server problem.

Hear us Apple: use some of those billions to make your web services better.



来源:https://stackoverflow.com/questions/8720316/ios-game-center-scores-not-showing-on-leaderboard-in-sandbox

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!