0

I'm implementing Game Center in my game and I present the leaderboards when the user presses a button with this simple bit of code:

let gcViewController = GKGameCenterViewController()
gcViewController.gameCenterDelegate = self
gcViewController.viewState = GKGameCenterViewControllerState.leaderboards
self.present(gcViewController, animated: true, completion: nil)

I've run into the following issue: If the user opens the leaderboards without an Internet connection, the presented view controller just says "No Data". Obviously, this is unavoidable, but then if I gain an Internet connection and re-open the leaderboards, it still says that; I have to restart the app with an Internet connection to see the data. Is there a way to force Game Center to reload its data before presenting a GKGameCenterViewController?

kmell96
  • 1,365
  • 1
  • 15
  • 39
  • I think this issue is common for all games and there isn't any solution for that. – Arash Etemad Apr 21 '18 at 20:33
  • I "fixed" it by refusing to use any Game Center features (including authentication) unless the user is connected to the internet. It seems like the issue is correlated to successfully authenticating when the user isn't connected to the internet. I think this is ok for my game because leaderboards are the only Game Center feature it uses, but it might not be a good solution for games that rely on Game Center for core features like matchmaking. – kmell96 Apr 22 '18 at 04:18

0 Answers0