I have an iMessage app, and trying to get Leaderboard scores. I am getting 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=0x600000ed3960 {Error Domain=GKServerErrorDomain Code=5043 "status = 5043, MyApp does not support leaderboards" UserInfo={GKServerStatusCode=5043, NSLocalizedFailureReason=status = 5043, MyApp does not support leaderboards}}}
Please note that my app is live, game center is enabled and it has been days since leaderboards were created on iTunes Connect.
func getScoreLeaderboard(leaderboardIdentifier:String, completion:@escaping ((_ resultScore:GKScore?) -> Void)) {
let leaderBoardRequest = GKLeaderboard()
leaderBoardRequest.identifier = leaderboardIdentifier
leaderBoardRequest.loadScores {
(resultGKScore, error) in
guard error == nil && resultGKScore != nil else {
completion(nil)
return
}
completion(leaderBoardRequest.localPlayerScore)
}
}
I have a doubt, but not sure it can be the problem. Problem might be:
I have an iMessage app with Bundle ID e.g. com.mygame
. On iTunes Connect, I made a test app to check in app purchase issue encountered. And its Bundle ID is com.mygame.MessagesExtension
.
I think that it is trying to get Leaderboard from app with extension bundle ID. Can it be possible? Since my app com.mygame
is live, I am unable to delete extension test app, though it is not being used.
Any help is appreciated.
I confirm that Leaderboard was being retrieved from test app instead of actual one. I end up implementing scores management via Firebase instead of Game Center. Apple customer services are pathetic.