When I use Group Leaderboard
in Game Center
do I need to use "grp" prefix in id's enumerated in my app?
In other words if I will set up my existing game to use Group Leaderboard
do I need to add "grp" prefix to each id in my app?
Okay, it works. You can move existing leaderboard to Group without performing any changes in application.
Hope that I do not break NDA, did not find any information about it, except this link - http://david-smith.org/blog/2012/06/18/ios-6-nda-cheatsheet/
Sorry if I've read your question incorrectly. But I believe the answer is yes.
I use a group leaderboard in my game and I submit a score as such.
#define LeaderboardID @"grp.yourleaderboardname"
GKScore *scoreReporter = [[GKScore alloc] initWithCategory:LeaderboardID];
scoreReporter.value = yourscore;
[scoreReporter reportScoreWithCompletionHandler:^(NSError *error) {
if (error != nil) {
NSLog(@"%@", error);
} else {
NSLog(@"%@", @"Success submitting score");
}
}];
[scoreReporter release];
Previous games that did not use group leaderboards my LeaderboardID was defined as such.
#define LeaderboardID @"com.yourcomapny.yourgame.yourleaderboardname"
So I believe you do have to change your id's to include the grp prefix.
the answer is Yes, you do have to change to the "grp." prefix. Here is why zakhej may have thought why he found the answer:
When, for example, you put a single leaderboard into a group, that single leaderboard will continue to exist. If you continue to report scores with your original category ID you will add them to the original single leaderboard, whereas using the 'grp.' prefix will add them to the new grouped one, which is essentially what you want to do. In short, putting a leaderboard in a group will result in there being two leaderboards, each getting updated with its own category ID.
Therefore it may seem that the original category ID will continue to work, but then you are looking at the old single leaderboard. This is why you might notice that sometimes the old category ID updates scores and sometimes it doesn't.
It took quite some time to figure this out, but Apple itunes Connect support explained it that way and it makes sense. Players who don't update the game will continue to report scores to an old leaderboard and will see that in game center. When they update later on they might get surprised to see their high score is a previous one from when you -the developer- added that leaderboard to the group.
This document is very helpful in planning Game Center implementations: https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnectGameCenter_Guide/iTunesConnectGameCenter_Guide.pdf
There were 2 different and opposite answers to this question so I thought I would express how my own experience turned out:
TL;DR Don't add the grp.
prefix.
- Had leaderboards on an app, no Game Center Group. The app was live
- Using
GKGameCenterViewController
for displaying the top scores worked fine - While the app was live I created a new Game Center Group and added it to it
- Changed the leaderboards ids to have the new id as shown on the group, i.e. with the
grp.
prefix - I was able to post scores to the leaderboards, but when launching
GKGameCenterViewController
it didn't open on the leaderboards I instantiated it with, it only opened on the dashboard, as if it couldn't recognise the ids anymore. - Changed back the leaderboards ids to be the original ones (without
grp.
) and now I was able to post scores again, and to useGKGameCenterViewController
as expected.
Conclusion: You can change the id to the new one with grp.
to post scores or not, the result is the same, but GKGameCenterViewController
only works if you use the original id.
© 2022 - 2024 — McMap. All rights reserved.