16

I'm building an iPhone game that supports Game Center (GC). When the app launches, I try to authenticate the local player...

 if([GKLocalPlayer localPlayer].authenticated == NO)
    {
        [[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error) 
         {
             [self callDelegateOnMainThread: @selector(processGameCenterAuth:) withArg: NULL error: error];
         }];
    }

Everything seemed to be working well. If the user wasn't signed into GC when the app launched, the app would display a dialog box giving them three options...

  1. Sign into existing account
  2. Create an account
  3. Cancel

This is the desired behavior, but while I was testing, I clicked the "Cancel" option and now the authentication process errors out every time with the following error "The requested operation has been cancelled." Even when I delete the app and reinstall it, it still errors out and that dialog box never pops ups now.

Does anyone know why this is happening or how I can fix it?

Thanks in advance for your wisdom!

BeachRunnerFred
  • 18,070
  • 35
  • 139
  • 238

1 Answers1

32

It turns out that is apple undocumented behavior.

After 3 times a user press cancel in a row, he has to go to the Game Center app and connect from there.

Go Figure.

BeachRunnerFred
  • 18,070
  • 35
  • 139
  • 238
  • 1
    Thanks for posting this! I had run into the same issue. – David Dunham Jan 24 '11 at 05:56
  • 3
    What is the solution if you need to sign into a sandbox account, and the Game Center app doesn't give you that option? I may be in a similar situation, except I see a `nil` error when I try to authenticate in the app. No modal sign-in dialog, nothing. – Tim Arnold Mar 25 '13 at 15:41
  • 1
    You can only sign in in sandbox mode when your app is build for debugging/adhoc. AppStore builds won't let you access the GameCenter sandbox for your app. – kervich May 24 '13 at 10:31