Guest User

Untitled

a guest
Jan 19th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. [[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error)
  2. {
  3. if (error != nil)
  4. {
  5. NSLog(@"LOGIN");
  6. } else {
  7. NSLog(@"CANT LOGIN");
  8. }
  9. }];
  10.  
  11. - (void) authenticateLocalPlayer
  12. {
  13. GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer];
  14. localPlayer.authenticateHandler = ^(UIViewController *viewController, NSError *error){
  15. if (viewController != nil)
  16. {
  17. [self showAuthenticationDialogWhenReasonable: viewController
  18. }
  19. else if (localPlayer.isAuthenticated)
  20. {
  21. [self authenticatedPlayer: localPlayer];
  22. }
  23. else
  24. {
  25. [self disableGameCenter];
  26. }
  27. }];
  28. }
Add Comment
Please, Sign In to add comment