Reputation: 11
I am using Facebook Sdk 4.1, https://developers.facebook.com/docs/sharing/ios#Advanced share_dialog I am using FBSDKShareDialog to share Video .It does share Video if user has installed facebook app," Idk whats wrong plz help me in sharing Video using FBSDK 4.1.
NSURL *movieUrl = [info objectForKey:UIImagePickerControllerMediaURL];
FBSDKShareDialog *shareDialog = [[FBSDKShareDialog alloc]init];
NSURL *videoURL=movieUrl;
FBSDKShareVideo *video = [[FBSDKShareVideo alloc] init];
video.videoURL = videoURL;
FBSDKShareVideoContent *content = [[FBSDKShareVideoContent alloc] init];
content.video = video;
shareDialog.shareContent = content;
shareDialog.delegate=self;
[shareDialog show];
i am getting response for console
error:Error Domain=com.facebook.sdk.share Code=2 "The operation couldn’t be completed. (com.facebook.sdk.share error 2.)" UserInfo=0x19784210 {com.facebook.sdk:FBSDKErrorArgumentValueKey=, com.facebook.sdk:FBSDKErrorArgumentNameKey=shareContent, com.facebook.sdk:FBSDKErrorDeveloperMessageKey=Share content must be FBSDKShareLinkContent or FBSDKSharePhotoContent in order to share with the share sheet.}
Upvotes: 1
Views: 2266
Reputation: 8057
This works with facebook app in device.
In may case i was having this error because i was testing in the simulator without facebook app.
Upvotes: 0
Reputation: 671
Please check: 1)The videos must be less than 12MB in size. 2)People who share should have Facebook for iOS client installed, version 26.0 or higher.
You should use the below line:
NSURL *movieUrl = [info objectForKey:UIImagePickerControllerReferenceURL];
instead of
NSURL *movieUrl = [info objectForKey:UIImagePickerControllerMediaURL];
Upvotes: 0
Reputation: 9246
How can somebody share file system URL in Facebook, you must provide a valid video URL for Example :- www.xyz.org/bunny.mp4
Just make your facts right,
"UIImagePickerControllerMediaURL
- Specifies the filesystem URL for the video."
Upvotes: 0