IOS - detect if Game Center is disabled

I am developing a single iphone game.

short version: the game center can be disconnected when the user refuses to authenticate 3 times. Is it possible to detect this disabled state?

Long version: If some of you have not had horror about this yet, if you cancel the authentication attempt in the game center 3 times, the game center will stop asking you to enter. After that, the functionality of the game center will not work, nor will you be notified when you try to use it. you just don't get anything. your buttons will be dead.

there is, however, one error message that is not returned, which is returned by the GC. I realized: hey, I'm just going to take a closer look at it when the error message returns, notifying the user that the game center is disconnected.

Well, that would be stupid because it turns out that this particular error message is displayed when you click on cancel on the current authentication prompt ... and even in other situations that I suppose. so at the moment I have a choice between never telling the player when the game center is disconnected, and hoping that they will invent it, or send them in an anonymous, broken look, when they really decline, and here and so on OK.

Is there a way to simply programmatically determine when the game center became disconnected this way? it would surely save everyone's damned heartache. I assume the answer is no, because non-alerting users were probably the thinking behind it in the first place. tell me I'm wrong someone!

+8
ios iphone game-center
source share
4 answers

I always check my game for 3 wrong attempts. This is so that I know that gamecenter is disabled, and I give the user the ability to switch to gamecenter and login when they click the gamecenter button.

+2
source share

As I know, there is no way. The game center is not completely disabled, but you need to go into the Game Center app and log in to use it again. Therefore, you can offer your users to do this (log in from the game center) if the attempt to use the game center failed. This is not the best solution, since you do not know the exact reason for its failure, but so far I have not found the best.

+1
source share

I recently had the same error, and I understood the following. When you verify the authenticity of a local player, you can catch an error that lets you know that Game Center is disabled.

- (void) authenticateLocalPlayer { GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer]; [localPlayer authenticateWithCompletionHandler:^(NSError *error) { if (error != nil) { // You get here if Game Center is disabled -- check error // to figure out what going on. } }]; } 

See the Apple documentation here.

+1
source share

The only way to solve this problem on iOS 7 is

Settings / General / Reset / Reset All settings

From there you will launch your application again. Game centers will work again.

-3
source share

All Articles