How to Upgrade Your iPhone Game to OpenFeint 2.4

Dec 21, 2009   //   by Derek van Vliet   //   Development  //  1 Comment

If you were watching twitter this week, you might have heard that OpenFeint 2.4 was quietly released to developers. This update surely stretches the definition of “point release” because it is packed with awesome new features as well as a complete overhaul of the interface.

If you are upgrading to OpenFeint 2.4 from a previous version, then it is not as easy as replacing the source code. However, it is still quite easy to make the upgrade if you just keep a few things in mind. Here’s what you need to know:

Disabling Chat

If you were previously disabling the chat feature in order to meet a certain parental ratings requirement, then you would be doing so by passing the OpenFeintSettingDisableChat setting into the initializeWithProductKey method. Since chat is not the only user-genereated content in OpenFeint 2.4, this setting name has been changed to OpenFeintSettingDisableUserGeneratedContent. Below is the new way to initialize OpenFeint with chat (and all user-generated content) disabled:

NSDictionary* settings = [NSDictionary dictionaryWithObjectsAndKeys:
			[NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight], OpenFeintSettingDashboardOrientation,
			@"Addicus", OpenFeintSettingShortDisplayName,
			[NSNumber numberWithBool:YES], OpenFeintSettingDisableUserGeneratedContent,
			nil];
 
OFDelegatesContainer* delegates = [OFDelegatesContainer containerWithOpenFeintDelegate:self
								andChallengeDelegate:self
								andNotificationDelegate:self];
 
[OpenFeint initializeWithProductKey:@"MY_PRODUCT_KEY"
			andSecret:@"MY_PRODUCT_SECRET"
			andDisplayName:@"Addicus"
			andSettings:settings
			andDelegates:delegates];

New Library Dependencies

If you replaced OpenFeint 2.3.x in your project with the new 2.4 source, you might have gotten a bunch of nasty errors upon building it. This is because the OpenFeint 2.4 requires more libraries to be added to your target. You need to add the following 3 frameworks to your target to get your OpenFeint 2.4 game to build successfully:

  • CFNetwork
  • CoreLocation
  • MapKit




Achievements and Social Networks

In OpenFeint 2.4, unlocking an achievement no longer prompts the user to notify their friends on Twitter and Facebook by default. However, you can restore this behaviour by setting the OpenFeintSettingPromptToPostAchievementUnlock setting to be true at the time of initialization. Below is how to initialize OpenFeint 2.4 with prompts to post achievements to social networks enabled:

NSDictionary* settings = [NSDictionary dictionaryWithObjectsAndKeys:
			[NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight], OpenFeintSettingDashboardOrientation,
			@"Addicus", OpenFeintSettingShortDisplayName,
			[NSNumber numberWithBool:YES], OpenFeintSettingPromptToPostAchievementUnlock,
			nil];
 
OFDelegatesContainer* delegates = [OFDelegatesContainer containerWithOpenFeintDelegate:self
								andChallengeDelegate:self
								andNotificationDelegate:self];
 
[OpenFeint initializeWithProductKey:@"MY_PRODUCT_KEY"
			andSecret:@"MY_PRODUCT_SECRET"
			andDisplayName:@"Addicus"
			andSettings:settings
			andDelegates:delegates];

1 Comment

  • [...] Icon 19. How to Format an NSString 20. How to Play a Video With MPMoviePlayerController 21. How to Upgrade Your iPhone Game to OpenFeint 2.4 22. How to Log to the Console Using NSLog 23. How to Suspend Touch Input 24. How to Open the SMS [...]

Leave a comment

Our Games

Latest Tweets