Game Center Compatibility

OpenFeint is 100% compatible with Game Center, Apples own system of achievements and leaderboards. If you are already using OpenFeint in your app, it is easy to tell OpenFeint to submit scores to both Game Center and OpenFeint leaderboards. If you are new to features like leaderboards and achievements, let OpenFeint simplify the process of incorporating the features offered by both Game Center and OpenFeint into your games. This document describes how to add Game Center support to an existing OpenFeint enabled project.

Perform OpenFeint Integration Perform the usual steps for OpenFeint integration. The README.html file included in the SDK package summarizes these steps. You may also refer to online documentation. Note that for Game Center compatibility, you will have to add GameKit.framework to your project frameworks.

Configure Leaderboards and Achievements Just as you define leaderboards and achievements on the OpenFeint developer dashboard you can do the same in the Manage Your Applications section of iTunes Connect. You will most likely want to keep a one-to-one correspondence between leaderboards and achievements defined with each service.

Establish Links Between OF & GC Leaderboards and Achievements Create a file called OFGameCenter.plist to establish links between the leaderboards and achievements defined with each service. Add it to your XCode project as you would your offline config file. OpenFeint will use this information to submit updates to Game Center on your behalf whenever you update an OpenFeint achievement or leaderboard. There is no need for you to change any of your code to take advantage of Game Center.

You can now enable Game Center support with one line of code. Simply add the following key-value pair

NSDictionary* settings = [
  NSDictionary dictionaryWithObjectsAndKeys:
  [NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight],  
    OpenFeintSettingDashboardOrientation,
    @"OFTest", OpenFeintSettingShortDisplayName,
    [
      NSNumber numberWithBool:YES], OpenFeintSettingGameCenterEnabled, //<<<-- Just add this.
      nil
    ];
    [
      OpenFeint initializeWithProductKey:@"one_key"
      andSecret:@"MyString"
      andDisplayName:@"Testing App"
      andSettings:settings
      andDelegates:delegates
    ];

to the settings dictionary passed as a parameter to [OpenFeint initializeWithProductKey: ...]. Below is what this the change looks like in context:

Ready To Go

If you have performed the steps above you should be ready to go with Game Center. To test, use your product key and secret defined on the OpenFeint developer dashboard with either your app or the OpenFeint sample app. Earn an achievement and post a high score. Users can see what theyve earned through the OpenFeint user dashboard embedded in the app or the Game Center app installed on their device.