简体   繁体   English

提交了Game Center得分,但排行榜没有得分

[英]Game Center score submitted, but leaderboard shows no score

I have a game that uses Game Center. 我有一个使用Game Center的游戏。

I'm playing the game, when the game ends, I send my score to GC. 我正在玩游戏,游戏结束时,我会将分数发送给GC。 After that, I'm checking my score with the method below. 之后,我将使用以下方法检查分数。

- (void)showLeaderboard
{   
    GKLeaderboardViewController *leaderboardController = [[GKLeaderboardViewController alloc] init];
    if (leaderboardController != NULL)
    {
        leaderboardController.category = self.currentLeaderBoard;
        leaderboardController.timeScope = GKLeaderboardTimeScopeAllTime;
        leaderboardController.leaderboardDelegate = self;

        UnityAppController* delegate = (UnityAppController*)[[UIApplication sharedApplication] delegate];

        [[delegate rootViewController] presentViewController:leaderboardController animated:YES completion:nil];

    }
}

That's just working fine, when I check it I can see my recent score on the leaderboard. 一切正常,当我检查它时,可以在排行榜上看到我最近的成绩。

But the problem starts after. 但是问题开始了。 The next day, when I check it again with the showLeaderboard() method, the leaderboard says "no score". 第二天,当我再次使用showLeaderboard()方法进行检查时,页首横幅显示“没有得分”。 If I play the game and send my score again it's just working fine again, I can see my score! 如果我玩游戏并再次发送分数,则表示一切正常,我可以看到分数! But, the next day the leaderboard says "no score" to me again! 但是,第二天排行榜再次对我说“不得分”! Like the leaderboard resets itself at 00.00 o'clock.. Just awkward.. 就像排行榜在00:00时重置自己一样。.尴尬..

Any suggestions? 有什么建议么? Thanks in advance.. 提前致谢..

Just make sure that you do the correct code for submitting the score. 只需确保您输入提交分数的正确代码即可。 This is a way that I really like. 我真的很喜欢这种方式。 Even though you will get warnings because they don't want you to use it in iOS 7, it still works. 即使您会因为他们不希望您在iOS 7中使用它而收到警告,它仍然可以工作。 Just let me know if it doesn't work. 请让我知道它是否无效。

(IBAction)submitscoretogamecenter{

GKLocalPlayer *localplayer = [GKLocalPlayer localPlayer];
[localplayer authenticateWithCompletionHandler:^(NSError *error) {

}];
//This is the same category id you set in your itunes connect GameCenter LeaderBoard
GKScore *myScoreValue = [[[GKScore alloc] initWithCategory:@"insertCategory"] autorelease];
myScoreValue.value = scoreInt;

[myScoreValue reportScoreWithCompletionHandler:^(NSError *error){

    //insert what happens after it's posted 

}];
[self checkAchievements];

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 游戏中心排行榜(沙盒)显示错误的分数 - Game Center Leaderboard (Sandbox) displays wrong score 游戏中心:可以通过身份验证,可以显示排行榜,可以显示帖子(我的分数),只有2位玩家? - Game Center: authenticates ok, shows leaderboard ok, posts (my) score ok, only 2 players? 更新已提交给Game Center的分数 - Update a score already submitted to Game Center 如何获得高分才能提交/报告给Game Center排行榜? - How to get high score to submit/reportt to Game Center Leaderboard? Swift 3 Game Center排行榜不保存得分值 - Swift 3 Game Center Leaderboard does not save the value of the score Game Center排行榜得分仅在应用恢复时更新 - Game Center Leaderboard score only updates when app resumes 游戏中心排行榜得分 - “20分”代替“20分” - Game Center leaderboard score - “20points” instead of “20 points” 如何使用Game Center实施“今日最佳成绩”排行榜? - How to implement a Best Score Today leaderboard using Game Center? 对于没有分数的玩家,永远不会要求Game Center排行榜分数要求的完成处理程序 - Game Center leaderboard score request's completion handler is never called for players that have no score 将高分上传到iOS中的Game Center排行榜时需要帮助修复我的代码 - Need help to fix my code when uploading a High Score to a Game Center leaderboard in iOS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM