Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

im trying to implement a method in my native iOS game the publish a story on face book such as this photo Facebook Activitys

most games that is integrated with facebook share stories like this in the activity section on the timeline

any good example especially for iOS 6

share|improve this question

1 Answer 1

What you are looking for is called "actions". Here is how to post an action.

// create an Open Graph action
id<FBOpenGraphAction> action = (id<FBOpenGraphAction>)[FBGraphObject graphObject];
[action setObject:objectId forKey:@"dish"];

// create action referencing user owned object
[FBRequestConnection startForPostWithGraphPath:@"/me/fbogsample:eat" graphObject:action completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
  if(!error) {
    NSLog([NSString stringWithFormat:@"OG story posted, story id: %@", [result objectForKey:@"id"]]);
    [[[UIAlertView alloc] initWithTitle:@"OG story posted"
                                message:@"Check your Facebook profile or activity log to see the story."
                               delegate:self
                      cancelButtonTitle:@"OK!"
                      otherButtonTitles:nil] show];
  } else {
    // An error occurred
    NSLog(@"Encountered an error posting to Open Graph: %@", error);
  }
}];

However, before you post a question about Facebook open-graph in general, you should check here first.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.