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.
- I have made 3 sandbox user accounts and posted with them all
- I have ensured my leaderboard id is accurately pasted into the code.
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)
}