Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8677795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:33:17+00:00 2026-06-12T20:33:17+00:00

Questions pretty much in the title, authPlayerWithCompletionHandler is Deprecated, so how do I use

  • 0

Questions pretty much in the title, authPlayerWithCompletionHandler is Deprecated, so how do I use authenticateHandler?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T20:33:19+00:00Added an answer on June 12, 2026 at 8:33 pm

    setAuthenticateHandler is new in iOS 6, authenticateWithCompletionHandler must still be used in iOS 5 and below.

    Also, providing a completion handler for presentViewController:animated:completion: is not really necessary since that completion handler is called just after the game center view is displayed, not when it is completed.

    Here’s my solution:

    NOTE – tested on iOS 4.3, iOS 5.1, iOS 6.0 simulators only – not on actual device.

    NOTE – this assumes you’ve checked that GameCenter API is available.

    - (void)checkLocalPlayer
    {
        GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer];
    
        if (localPlayer.isAuthenticated)
        {
            /* Perform additional tasks for the authenticated player here */
        }
        else
        {
            /* Perform additional tasks for the non-authenticated player here */
        }
    }
    
    #define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] \
    compare:v options:NSNumericSearch] == NSOrderedAscending)
    
    - (void)authenticateLocalPlayer
    {
            GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer];
    
            if (SYSTEM_VERSION_LESS_THAN(@"6.0"))
            {
                // ios 5.x and below
                [localPlayer authenticateWithCompletionHandler:^(NSError *error)
                 {
                     [self checkLocalPlayer];
                 }];
            }
            else
            {
                // ios 6.0 and above
                [localPlayer setAuthenticateHandler:(^(UIViewController* viewcontroller, NSError *error) {
                    if (!error && viewcontroller)
                    {
                        [[AppDelegate sharedDelegate].viewController
                        presentViewController:viewcontroller animated:YES completion:nil];
                    }
                    else
                    {
                        [self checkLocalPlayer];
                    }
                })];
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The question is pretty much in the title, but I will elaborate. I have
The title of the question pretty much states the problem. Is it possible?
Question in title pretty much sums it up. I have some resource object defined
The title pretty much sums up my question. When is it more efficient to
The title pretty much asks the whole question - How can I clear ONLY
The title pretty much explains the meat of the question. I'm debating on starting
Well the title pretty much sums the question. The only thing I found is
I am not much experienced in boost::asio . I've some pretty basic questions. Do
The question pretty much says it all. What supported JVM GC should we use
The question is pretty much the title. I have a 3d volume loaded as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.