I am trying to authenticate a GKLocalPlayer with Game Center. However, the code supplied by Apple
- (void) authenticateLocalPlayer
{
[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error) {
if (error == nil)
{
// Insert code here to handle a successful authentication.
NSLog(@"Logged in.");
}
else
{
// Your application can process the error parameter to report the error to the player.
NSLog(@"%@", [error description]);
}
}];
}
does not seem to do the trick for me. I always get an alert "Could not connect to Game Center server." with the option to "Retry" or "Cancel". Neither of the NSLog statements is executed, so I guess that the completionHandler is not even fired.
If I press retry, I get the following error:
Error Domain=GKErrorDomain Code=7 "The requested operation could not be completed because local player is already authenticating." UserInfo=0x8915f80 {NSLocalizedDescription=The requested operation could not be completed because local player is already authenticating.}
Anyone have any idea what is going wrong?
If you forgot this, contact Apple. Open your Settings Application then locate "Game Center" and tap on this. Your Game Center ID is your Apple ID.
To check if you are signed in to Game Center you should navigate to "Settings > Game Center", from this menu you can either create a Game Center profile, using an e-mail account of your choice, or log in to your existing account.
Bring even more fun and connection to your games with Game Center, Apple's social gaming network. Game Center lets players build an identity and connect with friends across Apple platforms.
One possible problem I found with connecting to Game Center is that your date may be wrong on the device. Check if your date is the actual current date. Somehow Game Center does not allow connections from devices with incorrect dates.
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