通知用户分数已提交给Game Center

问题描述:

是否有任何方法告诉用户他的分数成功提交或仅使用警报视图。通知用户分数已提交给Game Center

我的意思是这样的游戏中心欢迎留言:“欢迎回来,用户”

游戏中心得分提交实现你可以用它来处理错误或成功提交块回调。这是直接从开发者文档复制功能:

- (void) reportScore: (int64_t) score forCategory: (NSString*) category{ 
    GKScore *scoreReporter = [[[GKScore alloc] initWithCategory:category] autorelease]; 
    scoreReporter.value = score; 

    [scoreReporter reportScoreWithCompletionHandler:^(NSError *error) { 
    if (error != nil){ 
     //There was an error submitting the score. 
    }else { 
     //The score was successfully submitted. 
    } 
    }]; 
} 

在用户界面方面,如滑动体“欢迎回来”的观点,你必须做出你自己的用户界面。 (我只是用UIAlertview,但是这完全取决于你。)

我的意思是这样的游戏中心欢迎留言:“欢迎回来, 用户”

您可以在iOS 5使用GKNotificationBanner 。

Have a look at the reference