I am trying to share a link on the Facebook using FBSDKShareLinkContent
.
I have set the URL, description and title. SDK is automatically populates the titl
I've faced a same problem and found out one workaround - direct setting mode of FBSDKShareDialog instance to FBSDKShareDialogModeFeedWeb.
FBSDKShareDialog* dialog = [[FBSDKShareDialog alloc] init];
dialog.mode = FBSDKShareDialogModeFeedWeb;
dialog.shareContent = content;
dialog.fromViewController = self;
[dialog show];
It displays the feed dialog in a UIWebView within the app with preview of your post with right title and description.
Use quote property of FBSDKShareLinkContent instead
FBSDKShareLinkContent *linkContent = [FBSDKShareLinkContent new];
linkContent.quote = @"your quote";
FBSDKShareDialog *shareDialog = [FBSDKShareDialog new];
shareDialog.shareContent = linkContent;
setContentTitle
and setContentDescription
have been deprecated from Graph API 2.9.
For more information, see https://developers.facebook.com/docs/apps/changelog#v2_9_deprecations
I tried this code and it works perfectly on my virtual device, until I setted up Facebook account in setting of phone. After I set that, every time that I want to open dialog was opened default iOS social share dialog. Delete your account, if it exist in settings, or just install FB application, in documentation I saw that we need FB app for sharing.
If this will not help, you can always use Social Share framework of iOS, here is the example.
http://www.appcoda.com/ios-programming-101-integrate-twitter-and-facebook-sharing-in-ios-6/
Hope this will help, by the way, today I stack on this problems too, now every thing working great with this Social Sharing framework of iOS.
FBSDKShareDialogMode sets to FeedBrowser resolves my issue
let dialog = FBSDKShareDialog()
dialog.fromViewController = self
dialog.shareContent = shareLink
dialog.mode = FBSDKShareDialogMode.FeedBrowser
dialog.show()