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 1059669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:12:32+00:00 2026-05-16T18:12:32+00:00

I’m adding Game Center support to my game. Because my game can run on

  • 0

I’m adding Game Center support to my game. Because my game can run on iOS versions back to 3.0, I want to have it fallback to just saving achievements and leaderboards locally in the absence of Game Center.

Right now, I have this:

+ (BOOL) isGameCenterAvailable {
 Class playerClass = NSClassFromString( @"GKLocalPlayer" );
 if( playerClass != nil && [playerClass localPlayer] != nil ) {
  DebugLog( @"Game Center is available" );
  return YES;
 }

 DebugLog( @"Game Center is NOT available" );
 return NO;
}

However, this appears not to work at all. For one thing, despite the GKLocalPlayer reference stating that this class is available in iOS 4.1 and higher, the above test passes in iOS 4.0 (I didn’t try earlier versions). For another thing, the test also passes on devices which have iOS 4.1, but which otherwise don’t support Game Center (for example, an iPhone 3G).

I’ve gone through the various GameKit and Game Center docs online, and haven’t had any luck figuring this out. I could certainly detect the OS version, but that seems lame. That also wouldn’t help for the case of unsupported hardware (like a 3G). That could also be detected I suppose, but again, seems kinda lame.

What’s the “right way” to programmatically detect Game Center support?

  • 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-05-16T18:12:33+00:00Added an answer on May 16, 2026 at 6:12 pm

    This is the code provided in the GameKit documentation on Apple’s site:

    BOOL isGameCenterAvailable()
    {
        // Check for presence of GKLocalPlayer API.
        Class gcClass = (NSClassFromString(@"GKLocalPlayer"));
    
        // The device must be running running iOS 4.1 or later.
        NSString *reqSysVer = @"4.1";
        NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
        BOOL osVersionSupported = ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending);
    
        return (gcClass && osVersionSupported);
    }
    

    http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/GameKit_Guide/GameCenterOverview/GameCenterOverview.html%23//apple_ref/doc/uid/TP40008304-CH5-SW7

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I want use html5's new tag to play a wav file (currently only supported
I would like to run a str_replace or preg_replace which looks for certain words

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.