I am using Facebook SDK 4.0,https://developers.facebook.com/docs/sharing/ios#share_dialog
I am using FBSDKShareDialog
to share Photo.It does share Photo if user has installed Facebook app,
But it fails when user hasn't installed FB App. but they say "If someone doesn't have Facebook app installed it will automatically falls back to a web-based dialog."
Idk whats wrong please help me in sharing photo using FBSDK 4.0.
My code is
FBSDKSharePhoto *photo = [[FBSDKSharePhoto alloc] init];
photo.image = self.capturedImageView.image;
photo.userGenerated = YES;
FBSDKSharePhotoContent *content = [[FBSDKSharePhotoContent alloc] init];
content.photos = @[photo];
[FBSDKShareDialog showFromViewController:self
withContent:content
delegate:self];
This is error report
error:"com.facebook.sdk:FBSDKErrorArgumentNameKey=shareContent, com.facebook.sdk:FBSDKErrorDeveloperMessageKey=Feed share dialogs support FBSDKShareLinkContent."
FBSDKShareDialog only supports FBSDKShareLinkContent to post image or URL.So to use share Dialog you have to use FBSDKShareLinkContent.
You could use it as follows :
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.imageURL = [NSURL URLWithString:@"http://upload.wikimedia.org/wikipedia/commons/3/36/Hopetoun_falls.jpg"];
[FBSDKShareDialog showFromViewController:self
withContent:content
delegate:self];
If you want to share a link then just use content.contentURL
.
Refer to : https://developers.facebook.com/docs/sharing/ios#share_dialog
If you are using FBSDKSharePhoto then you need the native Facebook for iOS app installed.
Refer to :https://developers.facebook.com/docs/sharing/ios#photos
I also had the same issue as the documentation is also saying that they provide fallback mechanisms, which seems not true for this case:
Built-In Share Fallbacks
In past versions of the SDK for iOS, your app had to check for a native, installed Facebook app before it could open the Share Dialog. If the person didn't have the app installed, you had to provide your own code to call a fallback dialog.
Now the SDK automatically checks for the native Facebook app. If it isn't installed, the SDK switches people to their default browser and opens the Feed Dialog. If someone wants to share an Open Graph story, the SDK opens the Web Share Dialog.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With