I'm trying to tell my record in the game center. I think my code works, but the game center is not updated with a record. A leaderboard is created with this link name: "funfairBalloon" and this leaderboard ID ID: 55009943. I have 3 sandbox testers, the game center is on, and the players are authenticated in the game center.
and my code for authentication and report sending:
func authenticateLocalPlayer() { var localPlayer = GKLocalPlayer.localPlayer() localPlayer.authenticateHandler = { (viewController : UIViewController!, error : NSError!) -> Void in if viewController != nil { self.presentViewController(viewController, animated:true, completion: nil) } else { if GKLocalPlayer.localPlayer().authenticated { let gkScore = GKScore(leaderboardIdentifier: "55009943") gkScore.value = Int64(highscore) GKScore.reportScores([gkScore], withCompletionHandler: {(error) -> Void in let alert = UIAlertView(title: "Success", message: "Score updated", delegate: self, cancelButtonTitle: "Ok") alert.show() }) } } } }
Do you have an idea?
source share