插件 GameCenterUI.GameCenterDashboardExtension 无效
Plugin GameCenterUI.GameCenterDashboardExtension invalidated
plugin com.apple.GameCenterUI.GameCenterDashboardExtension invalidated
我正在尝试让一个简单的高分系统在我的游戏中运行。我已经在网上学习了所有的教程,这就是我现在所拥有的。
当用户打开应用程序时,我运行这段代码(InitialViewController)
//initiate gamecenter
func authenticateLocalPlayer(){
let localPlayer = GKLocalPlayer.localPlayer()
localPlayer.authenticateHandler = {(viewController, error) -> Void in
if (viewController != nil) {
self.presentViewController(viewController!, animated: true, completion: nil)
}
else {
print((GKLocalPlayer.localPlayer().authenticated))
}
}
}
然后,在用户完成游戏后,我使用此功能将他们的分数报告给 Game Center
//send high score to leaderboard
func saveHighscore(score:Int) {
// if player is logged in to GC, then report the score
if GKLocalPlayer.localPlayer().authenticated {
let gkScore = GKScore(leaderboardIdentifier: "ID_THAT_I_DOUBLE_CHECKED_MANY_TIMES")
gkScore.value = Int64(score)
GKScore.reportScores([gkScore], withCompletionHandler: { (error: NSError?) in
if (error != nil) {
// handle error
print("Error: " + error!.localizedDescription);
} else {
print("Score reported: \(gkScore.value)")
}
})
}
}
(我这里一般报错)
不确定这是否重要,但这是我打开和关闭排行榜的方式
//shows leaderboard screen
func showLeader() {
let vc = self
let gc = GKGameCenterViewController()
gc.gameCenterDelegate = self
vc.presentViewController(gc, animated: true, completion: nil)
}
//hides leaderboard screen
func gameCenterViewControllerDidFinish(gameCenterViewController: GKGameCenterViewController) {
gameCenterViewController.dismissViewControllerAnimated(true, completion: nil)
}
如果我可以再具体一点,请在下面评论,我在电脑旁等着。
我已经引用过 Stack Overflows
- GameCenter not updating leaderboard
- Swift - Integrate GameCenter to use leaderboards
这是我在排行榜上看到的唯一输出:
有其他方法吗?
我有完全相同的排行榜代码和完全相同的错误。一个多星期前它对我来说工作正常,就在最近我遇到了同样的错误。我猜这个问题是在Apple的末端。目前 Game Center 中可能存在错误。希望它会得到修复。终于。
plugin com.apple.GameCenterUI.GameCenterDashboardExtension invalidated
我正在尝试让一个简单的高分系统在我的游戏中运行。我已经在网上学习了所有的教程,这就是我现在所拥有的。
当用户打开应用程序时,我运行这段代码(InitialViewController)
//initiate gamecenter
func authenticateLocalPlayer(){
let localPlayer = GKLocalPlayer.localPlayer()
localPlayer.authenticateHandler = {(viewController, error) -> Void in
if (viewController != nil) {
self.presentViewController(viewController!, animated: true, completion: nil)
}
else {
print((GKLocalPlayer.localPlayer().authenticated))
}
}
}
然后,在用户完成游戏后,我使用此功能将他们的分数报告给 Game Center
//send high score to leaderboard
func saveHighscore(score:Int) {
// if player is logged in to GC, then report the score
if GKLocalPlayer.localPlayer().authenticated {
let gkScore = GKScore(leaderboardIdentifier: "ID_THAT_I_DOUBLE_CHECKED_MANY_TIMES")
gkScore.value = Int64(score)
GKScore.reportScores([gkScore], withCompletionHandler: { (error: NSError?) in
if (error != nil) {
// handle error
print("Error: " + error!.localizedDescription);
} else {
print("Score reported: \(gkScore.value)")
}
})
}
}
(我这里一般报错)
不确定这是否重要,但这是我打开和关闭排行榜的方式
//shows leaderboard screen
func showLeader() {
let vc = self
let gc = GKGameCenterViewController()
gc.gameCenterDelegate = self
vc.presentViewController(gc, animated: true, completion: nil)
}
//hides leaderboard screen
func gameCenterViewControllerDidFinish(gameCenterViewController: GKGameCenterViewController) {
gameCenterViewController.dismissViewControllerAnimated(true, completion: nil)
}
如果我可以再具体一点,请在下面评论,我在电脑旁等着。
我已经引用过 Stack Overflows
- GameCenter not updating leaderboard
- Swift - Integrate GameCenter to use leaderboards
这是我在排行榜上看到的唯一输出:
有其他方法吗?
我有完全相同的排行榜代码和完全相同的错误。一个多星期前它对我来说工作正常,就在最近我遇到了同样的错误。我猜这个问题是在Apple的末端。目前 Game Center 中可能存在错误。希望它会得到修复。终于。