Sto cercando di autenticare un GKLocalPlayer con Game Center. Tuttavia, il codice fornito da AppleAutenticazione GKLocalPlayer con Game Center
- (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]);
}
}];
}
non sembra fare il trucco per me. Ricevo sempre un avviso "Impossibile connettersi al server Game Center." con l'opzione "Riprova" o "Annulla". Nessuna delle istruzioni NSLog è stata eseguita, quindi suppongo che il completamentoHandler non venga nemmeno licenziato.
Se io premere Riprova, ottengo il seguente errore:
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.}
Qualcuno ha idea di cosa c'è di sbagliato?
Avendo questo problema sul mio app. Ho appena aggiornato a 4.2. Non ho idea se lo stia causando - mai provato in 4.1. Qualche suggerimento su cosa fare al riguardo? –