视频发布到Facebook墙

时间:2012-06-22 07:04:51

标签: facebook-graph-api ios5

如何将录制的视频发布到Facebook墙上并附上留言,请告诉我是否有可能将视频发布到Facebook上。

1 个答案:

答案 0 :(得分:0)

请查看此文章:How-To: Use the Graph API to Upload a Video (iOS)

- (void)fbDidLogin {
    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"mov"];
    NSData *videoData = [NSData dataWithContentsOfFile:filePath];
    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   videoData, @"video.mov",
                                   @"video/quicktime", @"contentType",
                                   @"Video Test Title", @"title",
                                   @"Video Test Description", @"description",
                       nil];
    [facebook requestWithGraphPath:@"me/videos"
                         andParams:params
                     andHttpMethod:@"POST"
                       andDelegate:self];
}