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上的視頻共享。 在此先感謝。視頻分享FBSDKGraphRequest
你能否解釋一下你所說的「代碼不工作」是什麼意思? – Amila
代碼正在工作,但視頻不在Facebook上共享 – Anitha