5

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

enhzflep
  • 12,927
  • 2
  • 32
  • 51
Praveen B
  • 71
  • 4

1 Answers1

0

Use UIImagePickerControllerReferenceURL instead of UIImagePickerControllerMediaURL.

Rahul Joshi
  • 71
  • 1
  • 6