3

Trying to test out a leaderboard. I do this:

GKLeaderboard *leaderboardRequest = [[GKLeaderboard alloc] init];
    if (leaderboardRequest != nil)
    {
        leaderboardRequest.playerScope = GKLeaderboardPlayerScopeGlobal;
        leaderboardRequest.timeScope = GKLeaderboardTimeScopeAllTime;
        leaderboardRequest.category = self.gameData.leaderboardId;
        leaderboardRequest.range = NSMakeRange(1,10);
        [leaderboardRequest loadScoresWithCompletionHandler: ^(NSArray *scores, NSError *error) {
            if (error != nil)
            {
                // Handle the error.
            }
            if (scores != nil)
            {
                for (GKScore *score in scores) {
                    NSLog(@"score retrieved: %lld", score.value);
                }
            }
        }];
    }

I play the game on one device with user A, and get a score of 137. When I query the leaderboard I get the one 137 score back. I play on another device with user B, score 243, and get only the 243 score back when I query the leaderboard.

So why am I only getting back scores from the user that is logged in? Obviously I need everyone's scores to create a custom leaderboard. It is my understanding that GKLeaderboardPlayerScopeGlobal should retrieve all scores, not just those for the local user.

soleil
  • 12,133
  • 33
  • 112
  • 183

0 Answers0