Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Development: Strange problem with authenticating Game Center user

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!

like image 309
BeachRunnerFred Avatar asked Jan 01 '11 22:01

BeachRunnerFred


People also ask

How do you authenticate Game Center?

Game Center also checks whether you configured your game for Game Center. To authenticate the user, set the authentication handler ( authenticateHandler ) on the shared instance of GKLocalPlayer that represents the player of your game as in: GKLocalPlayer. local.

Why does my Iphone not have Game Center?

iOS 10 removed the game center app and it cannot be downloaded. You can still access your account and settings in Settings->Game Center, And for friend management and invitations it must be done through the Games that support it and the Messages App.


1 Answers

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.

like image 158
BeachRunnerFred Avatar answered Sep 21 '22 14:09

BeachRunnerFred