Here's my situation:
1) The user opens my application for the first time. I immediately call authenticateLocalUser to try and log them into Game Center. The popup with the Login, Create Account, and Cancel buttons successfully appears.
2) The user doesn't want to log in right now, so they click Cancel. (This is NOT the 3rd time they've clicked 'cancel', and I am NOT receiving the 'Game center disabled, log in from the Game Center app to enable' message.) The user can continue to use my app as normal.
3) The user wants to use Game Center later on, so they click a button I have given them to log into the Game Center. I again call authenticateLocalUser. This time, the popup does NOT appear. In fact nothing happens, except that I receive these console log messages:
2012-04-26 08:38:42.861 Clink[332:707] authenticateWithCompletionHandler: enter
2012-04-26 08:38:42.863 Clink[332:707] authenticateWithCompletionHandler: exit
4) I have tested both immediately pushing the button which calls authenticateLocalUser again, and also waiting a significant period of time before doing so. At whatever point I call authenticateLocalUser again, once again nothing appears, and I get this error from the function:
Error Domain=GKErrorDomain Code=7 "The requested operation could not be completed because local player is already authenticating."
So what appears to be happening is that, when I call authenticateLocalUser in Step 3, I am asking Game Center to authenticate but it is getting hung up and not responding to my request. Then in Step 4 when I try again, it tells me it cannot process my request because it is already trying to authenticate. However I have waited up to 10 minutes for a response from my request in Step 3, and I never get one from the Game Center.
This is the content of my authenticateLocalUser function. As far as I recall i haven't changed it from the version I downloaded from Apple's sample code.
- (void) authenticateLocalUser
{
if([GKLocalPlayer localPlayer].authenticated == NO)
{
[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error)
{
[self callDelegateOnMainThread: @selector(processGameCenterAuth:) withArg: NULL error: error];
}];
}
}
Has anyone else encountered this problem before or have any ideas about what might be going on? I've been looking at this for a while and am not really sure what's happening.
Thanks in advance!!
I had the same problem when I had another Game Center Account Authenticated. It happens when you login into some game with your normal account and at the same time with your test one.
Just reset your device settings and don't login with your real account into other games while testing. It happens when you do both at the same time. Reset your device settings, clean the project and it should be ok. And use only test iTunes accounts to test your game.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With