Skip to content

Instantly share code, notes, and snippets.

@ebsaral
Last active August 29, 2015 14:11
Show Gist options
  • Save ebsaral/613d4f8f1e438dd49ff5 to your computer and use it in GitHub Desktop.
Save ebsaral/613d4f8f1e438dd49ff5 to your computer and use it in GitHub Desktop.
Sending an Open Graph message with video.wants_to_watch action
// In order to display a Open Graph Action in your Facebook Share Dialog (FBDialog), you can construct your code like this:
NSMutableDictionary<FBOpenGraphAction> *action = (NSMutableDictionary<FBOpenGraphAction> *)[FBGraphObject graphObject];
NSMutableDictionary *graphObject = [FBGraphObject openGraphObjectForPostWithType:@"video.movie"
title:@"My movie."
image:@"http://www.mymovie.com/poster.jpg"
url:@"http://www.mymovie.com"
description:@"This movie may contain adult material."];
action[@"movie"] = graphObject;
[FBDialogs presentMessageDialogWithOpenGraphAction:action
actionType:@"video.wants_to_watch"
previewPropertyName:@"movie"
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if (error) {
NSLog(@"error: %@", [error localizedDescription]);
} else {
NSLog(@"results: %@", results);
}
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment