Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error)
- {
- if (error != nil)
- {
- NSLog(@"LOGIN");
- } else {
- NSLog(@"CANT LOGIN");
- }
- }];
- - (void) authenticateLocalPlayer
- {
- GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer];
- localPlayer.authenticateHandler = ^(UIViewController *viewController, NSError *error){
- if (viewController != nil)
- {
- [self showAuthenticationDialogWhenReasonable: viewController
- }
- else if (localPlayer.isAuthenticated)
- {
- [self authenticatedPlayer: localPlayer];
- }
- else
- {
- [self disableGameCenter];
- }
- }];
- }
Add Comment
Please, Sign In to add comment