nihalahmed / GameCenterManager

iOS Game Center helper singleton
Other
715 stars 128 forks source link

How can we retrieve the player rank in a given leaderboard? #12

Open piegaro opened 10 years ago

piegaro commented 10 years ago

Hi

Thanks a lot for this lib. The call [[GameCenterManager sharedManager] highScoreForLeaderboard:@"LeaderboardID"] is very useful.

I am having a hard time trying to do the same thing but to retrieve the player rank (position in the leaderboard). Would it be easy for you to provide the highRankForLeaderboard method as well?

Thanks very much, have a nice day.

Sam-Spencer commented 10 years ago

Sure, sounds like a good idea! This will be implemented in a future version.

SoundBlaster commented 10 years ago

You can get rank inside -syncGameCenter in place where array GCMLeaderboards is processed. But there is need one improvement — current version of GCM works with ONE leaderboard for the game. It's awful...

Sam-Spencer commented 10 years ago

Hi @SoundBlaster, there are some major improvements coming to many aspects of GCManager (including leaderboard retrieval features). For now, you can use the GameKit block-based APIs to get leaderboards and the user's rank on each:

[GKAchievement loadScoresWithCompletionHandler:^(NSArray *scores, NSError *error) {
    for (GKScore *score in scores) {
        // Handle each score
    }
}];