I'm attempting to integrate a macOS game with Apple's GameKit SDK using Objective-C. So far I have been able to authenticate the user and load/update achievements, but I have had no success with leaderboards.
When attempting a loadLeaderboardsWithCompletionHandler request, I get this error:
Error Domain=GKErrorDomain Code=3 "The requested operation could not be completed due to an error communicating with the server." UserInfo={GKServerStatusCode=5043, NSLocalizedDescription=The requested operation could not be completed due to an error communicating with the server., NSUnderlyingError=0x600000158960 {Error Domain=GKServerErrorDomain Code=5043 "status = 5043, MyGame does not support leaderboards" UserInfo={GKServerStatusCode=5043, NSLocalizedFailureReason=status = 5043, MyGame does not support leaderboards}}}
When trying
GKLeaderboard * leaderLoader = [[GKLeaderboard alloc] init];
leaderLoader.identifier = @"grp.lvl1";
[leaderLoader loadScoresWithCompletionHandler` ...
The completion handler is never called.
I'm having trouble understanding why Apple's endpoint says my game does not support leaderboards. So far I have:
- Enabled GameCenter for our app identifier
- Enabled GameCenter on our app's App Store Connect page (currently in "prepare for submission" state)
- I've added a leaderboard to our app group via the Features menu in App Store Connect and imported it onto the macOS App Store page
But still nothing. Any ideas?
If your leaderboard is in a group, it seems to break. Mine was working fine until I added it to a group, then it just broke. Removing it started it working again. Be interested to hear if it fixes it for you, could be worth filing a radar.