Last active
August 29, 2015 14:11
-
-
Save ebsaral/613d4f8f1e438dd49ff5 to your computer and use it in GitHub Desktop.
Sending an Open Graph message with video.wants_to_watch action
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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