Garrett Cox
Garrett Cox

Reputation: 713

GameCenter showing "No Challenges Screen"

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.

  1. I have made 3 sandbox user accounts and posted with them all
  2. 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)
}

Upvotes: 0

Views: 71

Answers (1)

Garrett Cox
Garrett Cox

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

Related Questions