Friday 13 November 2020

GKLocalPlayer fetchSavedGamesWithCompletionHandler returns 0 games on installation

I can save my game and also fetch it but if I uninstall the game and then install it again, the call to fetchSavedGamesWithCompletionHandler returns 0 games (even if I call it several times). And if I call it again after some few seconds, the GKLocalPlayer manages to fetch the game i previously saved.

The error is nil so there is no problem with connecting to Game Center or iCloud (if there was problem with iCloud, the error wouldn't be nil and it would say that the user isn't connected to iCloud or that iCloud Drive isn't on).

This is not the same if anyone thought of sharing that with me: https://stackoverflow.com/questions/34445258/gklocalplayer-fetchsavedgameswithcompletionhandler-result-depends-on-device

Sure I can just fix it by implementing a timer and then call fetchSavedGamesWithCompletionHandler accordingly, but that's just a bad way of fixing it considering that the game is gonna support the slower devices (iPhone 5s compared to iPhone 7).



from GKLocalPlayer fetchSavedGamesWithCompletionHandler returns 0 games on installation

No comments:

Post a Comment