游戏中心支持
我想将游戏中心排行榜添加到我的应用程序中。
在一些 YouTube 视频和其他视频中,我发现您需要在 iTunes Connect 中的排行榜中输入一个类别。我在哪里这样做,因为我没有被要求这样做。
或者你能告诉我如何添加游戏中心吗?我现在所做的是:
GKScore *myScoreValue = [[GKScore alloc] initWithCategory:@"moveItQuickLeaderbord"];
myScoreValue.value = Punkte;
[myScoreValue reportScoreWithCompletionHandler:^(NSError *error){
if(error != nil){
NSLog(@"Score Submission Failed");
NSLog([NSString stringWithFormat:@"%@", error]);
} else {
NSLog(@"Score Submitted");
}
}];
并且在视图中确实加载了:
[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error){
if (error ==nil) {
NSLog(@"Success");
} else {
NSLog(@"Fail");
NSLog([NSString stringWithFormat:@"%@", error]);
}
}];
当我上传分数时,我总是收到分数提交消息,但如果我查看排行榜,它不包含任何值?
I want to add game center leaderboards to my app.
In some youtube videos and other tut's i've seen that you need to enter a category to the leaderboard in itunes connect. Where do I do that, because i don't get asked to do so.
Or could you tell me how to add game center anyways? what i did now is:
GKScore *myScoreValue = [[GKScore alloc] initWithCategory:@"moveItQuickLeaderbord"];
myScoreValue.value = Punkte;
[myScoreValue reportScoreWithCompletionHandler:^(NSError *error){
if(error != nil){
NSLog(@"Score Submission Failed");
NSLog([NSString stringWithFormat:@"%@", error]);
} else {
NSLog(@"Score Submitted");
}
}];
and in the view did load:
[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error){
if (error ==nil) {
NSLog(@"Success");
} else {
NSLog(@"Fail");
NSLog([NSString stringWithFormat:@"%@", error]);
}
}];
when i upload my score i always get the score submitted message but if i look at the leaderboard it does not contain any values?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您已注册 iOS 开发者计划,您应该可以访问 iTunes Connect 网站。在那里,您需要设置应用程序 ID 并激活 Game Center。之后,您可以创建排行榜并输入唯一的 ID 以及其他属性。
If you have enrolled in the iOS Developer program, you should have access to the iTunes Connect website. There, you need to setup an App ID and activate Game Center. After that you can create a leaderboard and enter an unique id for in as well as other properties.