mardi 31 mars 2015

Use the Facebook iOS SDK to post an open graph action with a video

I've created a Facebook App for my iOS application and set up the proper app ID and url scheme handling. I've also created an Open Graph Story, with one Action (called "create"), and one Object. The Object is Facebook's Common Type video.other object.


To test using the newest (4.0+) API, I use the following code to post (successfully, just without video content):



NSDictionary *properties = @{
@"og:type": @"video.other",
@"og:title": @"Test title",
};
FBSDKShareOpenGraphObject *object = [FBSDKShareOpenGraphObject objectWithProperties:properties];

FBSDKShareOpenGraphAction *action = [[FBSDKShareOpenGraphAction alloc] init];
action.actionType = @"myappnamespace:create";
[action setObject:object forKey:@"video:other"];

FBSDKShareOpenGraphContent *content = [[FBSDKShareOpenGraphContent alloc] init];
content.action = action;
content.previewPropertyName = @"video:other";

[FBSDKShareDialog showFromViewController:self withContent:content delegate:self];


Is there a way to attach video data and not simply a URL to a video hosted externally?


Aucun commentaire:

Enregistrer un commentaire