Reputation: 713
I have thoroughly followed many tutorials on integrating GameCenter into my app. I am using the proper code to post scores and getting report that the scores are being reported to GC. However, when I try to load the leaderboard it shows a "No Challenges" blank screen instead.
I have combed over as many relevant stackoverflow questions as I can, as well as looked at the documentation. Neither has helped solve my problem.
Some extra information to prevent worthless answers from trolls on this post.
The code for auth //initiate gamecenter func authenticateLocalPlayer(){
let localPlayer: GKLocalPlayer = GKLocalPlayer.localPlayer()
localPlayer.authenticateHandler = {(viewController, error) -> Void in
if (viewController != nil) {
self.presentViewController(viewController, animated: true, completion: nil)
}
else {
println((GKLocalPlayer.localPlayer().authenticated))
}
}
}
The code for displaying leaderboard
func showLeaderboard() {
// declare the Game Center viewController
var gcViewController: GKGameCenterViewController = GKGameCenterViewController()
gcViewController.gameCenterDelegate = self
gcViewController.viewState = GKGameCenterViewControllerState.Leaderboards
// Remember to replace "Best Score" with your Leaderboard ID (which you have created in iTunes Connect)
gcViewController.leaderboardIdentifier = "1019900515.HighScore"
// Finally present the Game Center ViewController
//self.showViewController(gcViewController, sender: self)
// self.navigationController?.pushViewController(gcViewController, animated: true)
self.presentViewController(gcViewController, animated: true, completion: nil)
}
Upvotes: 0
Views: 71
Reputation: 713
After a day, I hadn't changed any part of the code but the stats started working. It must have been on Apple's side with their server then. The answer was patience.
Upvotes: 1