简体   繁体   中英

Error on Facebook Video Sharing IOS Objective C

I'm trying to share a video on Facebook, I'm using fbsdk new version 4.1.0 i have also followed the instruction given in developer.facebook.com

  • The videos must be less than 12MB in size.
  • People who share should have Facebook for iOS client installed, version 26.0 or higher.

I have used the following code to share a video in 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];

but the issue im getting is,

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}

Thanks

使用UIImagePickerControllerReferenceURL而不是UIImagePickerControllerMediaURL。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM