authenticateWithCompletionHandler: is deprecated: first deprecated in iOS 6.0

前端 未结 1 680
时光取名叫无心
时光取名叫无心 2021-01-05 06:29

I am working on game which is using Game Center and I get next warning;

... \'authenticateWithCompletionHandler:\' is deprecated: first deprecated in iOS 6.0

相关标签:
1条回答
  • 2021-01-05 06:55

    Yes, you have to manually present the login form with iOS6, this gives you more control over when to present the screen. Give this a try

    localPlayer.authenticateHandler = ^(UIViewController *viewController,NSError *error) {
    if (localPlayer.authenticated) { 
    //already authenticated
    } else if(viewController) {
    [self presentViewController:viewController];//present the login form
    } else {
    //problem with authentication,probably bc the user doesn't use Game Center
    } 
    };
    
    0 讨论(0)
提交回复
热议问题