I have a problem with logging a user to the Game Center. I first present the
login dialog right after the application finishes loading. If the user cancels
the dialog, I want to give him the option to change his mind by providing a
login button in my main menu. However, on iPads with iOS7, the button doesn't do
anything - the Game Center dialog doesn't get shown (it works correctly on
iOS6). Instead, I immediately get the error "The requested operation has been
cancelled or disabled by the user." Same code is called on application launch
and on the button tap. It uses the authenticateWithCompletionHandler method and
basically looks like:
GKLocalPlayer* localPlayer = [GKLocalPlayer localPlayer];
[localPlayer authenticateWithCompletionHandler:^(NSError *error)
{
OnLogin(error);
}];
(I know the method is deprecated, but my experience with the new one has been
even worse).
The interesting thing is that the GC dialog DOES appear if I move the
application to the background and then bring it back to the foreground.
The issue I describe happens even after the first cancel, so I don't think it
has anything to do with Game Center banning applications after 3 cancels.
Does anyone know how to fix this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…