Showing posts with label OpenFeint. Show all posts
Showing posts with label OpenFeint. Show all posts

Saturday, March 5, 2011

Telling Openfeint that the challenge has been won/lost/tied

Are you having trouble telling the OpenFeint service when player B has won/lost/tied a challenge created by Player A?

Probably because the documentation is awful and there's little out there on OpenFeint challenges. It's relatively easy to get Player A to create challenges, but it's difficult to get Player B to get the challenge, its data, play it and then send back the result to the OpenFeint servers. One tip I have for you is to do with storing and using challenge data.

In your app's implementation of the challenge delegate sure that you have included #import "OFChallengeToUser.h" in the .h or .m of the delegate. Check out the main method of the delegate:

-(void) userLaunchedChallenge:(OFChallengeToUser*)challengeToLaunch withChallengeData:(NSData*)challengeData

Its first parameter is a OFChallengeToUser type. With OFChallengeUser.h included you can now call methods on challengeToLaunch:

NSString *challengeOriginatorUserID = [challengeToLaunch resourceId]


I could not call this method without the include. This data can now be stored and used where it is required by Player B to inform Openfeint that he has completed the challenge sent by Player A using the call:

[OFChallengeService submiteChallengeResult: challengeOriginatorUserID result:kChallengeResultRecipientWon resultDescription:@"I won" onSuccess:success onFailure:failure]


Friday, March 4, 2011

Openfeint server connectivity issues

Are you developing an OpenFeint app?

Are you experiencing unstable connections to the OpenFeint service?

Are you developing on an iPhone/Pod 4 device?

If yes then this could be the solution to your connectivity problem.

1. Open <yourApp>-Info.plist

2. Add the "Application does not run in background" key

3. Click it on

Like so:


This should fix your issues with OpenFeint service connectivity issues.

The issues occur because of the multi tasking features of iPhone 4. These features seem to mess up the OpenFeint service.

Share