【发布时间】:2015-08-28 05:31:16
【问题描述】:
if ([[FBSDKAccessToken currentAccessToken] hasGranted:@"publish_actions"])
{
NSData *videoData = [NSData dataWithContentsOfURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"rabbit" ofType:@"mp4"]]];
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/me/videos"
parameters:@{@"source":videoData}
HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
if (result) {
NSLog(@"video shared successfully !!!!!!!! %@",result);
}
else{
NSLog(@"Error %@",error.description);
}
// Handle the result
}];
}
我尝试了此代码,但它不起作用...有人可以告诉如何在 FBSDKGraphRequest 上实现视频共享。 提前致谢。
【问题讨论】:
-
您能详细说明“代码不工作”是什么意思吗?
-
代码正在运行,但视频未在 facebook 上分享
标签: ios objective-c iphone facebook