Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Game Center authentication error

I'm trying to call the authentication method of game center, however no authentication screen comes up and the callback return with an error : "the requested operation has been canceled".

The code :

[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error)
     {
        NSDictionary *userInfo = nil;
        if (error == nil) {

            NSLog(@"Game Center successfully authenticated");
        }
        else {
            userInfo = [NSDictionary dictionaryWithObject:error forKey:@"NSError"];
        }
        [[NSNotificationCenter defaultCenter] postNotificationName:Notification
                                                            object:self
                                                          userInfo:userInfo];

    }];

Any idea what can cause this issue ?

like image 308
Idan Avatar asked Dec 05 '22 00:12

Idan


1 Answers

In iOS 4.2 when a user cancels the login to Game Center, after 3 attempts that error is returned. You can resolve the error by logging in using the Game Center app, then try your app again, you should see the welcome back message from Game Center in your app

like image 168
Greg Meach Avatar answered Jan 20 '23 08:01

Greg Meach