Facebook视频共享IOS目标C出错

时间:2015-05-27 07:38:47

标签: ios objective-c facebook facebook-graph-api

我试图在Facebook上分享视频,我使用fbsdk新版本4.1.0我也遵循了developer.facebook.com中的说明

  • 视频的大小必须小于12MB。
  • 分享的用户应安装适用于iOS客户端的Facebook,版本26.0或更高版本。

我使用以下代码在Facebook上分享视频

FBSDKShareDialog *shareDialog = [[FBSDKShareDialog alloc]init];

NSURL *videoURL=[info objectForKey:UIImagePickerControllerMediaURL];

FBSDKShareVideo *video = [[FBSDKShareVideo alloc] init];
video.videoURL = videoURL;
FBSDKShareVideoContent *content = [[FBSDKShareVideoContent alloc] init];
content.video = video;

shareDialog.shareContent = content;
shareDialog.delegate=self;
[shareDialog show];

但问题是,

Error Domain=com.facebook.sdk.share Code=2 "The operation couldn’t be completed. (com.facebook.sdk.share error 2.)" UserInfo=0x174479f40 {com.facebook.sdk:FBSDKErrorArgumentValueKey=<FBSDKShareVideoContent: 0x174475040>, com.facebook.sdk:FBSDKErrorDeveloperMessageKey=Only asset file URLs are allowed for the native dialog., com.facebook.sdk:FBSDKErrorArgumentNameKey=videoURL}

由于

1 个答案:

答案 0 :(得分:0)

使用UIImagePickerControllerReferenceURL代替UIImagePickerControllerMediaURL。