Our app has functionality where user can share the posts from one of our FB page feed.
It works perfectly fine for any kind of link if device has FB native app installed but if it doesn't then it only works for few links. I couldn't understand why it is happening.
Link works successfully:
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:#"https://www.facebook.com/bigfishgames/videos/10154487015659966/"];
Link not working:
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:#"https://www.facebook.com/bigfishgames/photos/a.89705929965.104855.10172494965/10154513459844966/?type=3"];
All right, after filing bug to facebook they have fixed this issue.
Related
In my app, I am using SLComposeViewController to post images on Facebook app, which works fine. Requirement is, if the Facebook app is not installed, I would like to open the web page and allow user to post the image though web. Please anyone can advise how to post the image on Facebook web? I have iOS 9 and above with Xcode 8.1.
Use Facebook SDK for post image to facebook. You can find code and documentation here:
https://developers.facebook.com/docs/sharing/ios
Facebook SDK will handle all types of exception and scenario.
If Facebook app is not installed. but you FB accounts synced with setting app in your iPhone.
you can use below code to share the photo. But it will not open web browser.
FBSDKSharePhoto *photo = [[FBSDKSharePhoto alloc] init];
photo.image = img; // your image
FBSDKSharePhotoContent *content = [[FBSDKSharePhotoContent alloc] init];
content.photos = #[photo];
[FBSDKShareDialog showFromViewController:self
withContent:content
delegate:self];
To share via web browser, you can use below code.
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.imageURL = [NSURL URLWithString:img]; // image url
[FBSDKShareDialog showFromViewController:self.viewController
withContent:content
delegate:self];
I'm using FBSDKShareLinkContent to display a dialog to share a link to Facebook. No matter the link I use (I even tried with https://google.com/) when the post / link is tapped in the Facebook app my app is launched.
I want, however, to load the link in a web browser or the FB browser instead (and not have it launch my app or navigate to the app store). Is there anyway to achieve this? I tried both FBSDKShareDialogModeFeedWeb and FBSDKShareDialogModeAutomatic.
Here is my current code:
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:#"https://google.com/"];
FBSDKShareDialog* dialog = [[FBSDKShareDialog alloc] init];
dialog.mode = FBSDKShareDialogModeFeedWeb;
dialog.shareContent = content;
dialog.fromViewController = self;
[dialog show];
Add this to your code:
FBSDKShareLinkContent *content1 = [[FBSDKShareLinkContent alloc] init];
content1.contentURL = [NSURL URLWithString:#"http://en.wikipedia.org/wiki/Facebook"];
content1.contentTitle=#"Share";
[FBSDKShareDialog showFromViewController:self withContent:content1 delegate:nil];
I'm trying to implement deep linking in my iOS app, so far I can post to my wall but only posts that are really links that goes to google.com (obviously this is a test link). I want the user to be navigated to my app when clicking on the post through the Facebook app, please I need a step by step guide cause Facebook documentation about its a little bit complicated. Here's my code:
- (void)shareOnFacebookWithName:(NSString *)contentTitle withDescription:(NSString *)contentDescription withLink:(NSString *)contentURL withPictureLink:(NSString *)imageURL andViewController:(UIViewController*)viewController{
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:contentURL];
content.contentTitle = contentTitle;
content.imageURL = [NSURL URLWithString:imageURL];
content.contentDescription = contentDescription;
[FBSDKShareDialog showFromViewController:viewController
withContent:content
delegate:self];
}
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:APPSTORE_URL_MAIN];
content.contentTitle = INVITE_TITLE;
content.imageURL = [NSURL URLWithString:INVITE_IMG_URL];
content.contentDescription = INVITE_TEXT;
[FBSDKMessageDialog showWithContent:content delegate:self];
If the Facebook Messenger app is closed, this just opens the app and does nothing else.
Works fine is the FB Messenger app is working in background
Issue resolved by Facebook Developers.
I am using FBSDK sharebutton in my application using latest fbSDK for iOS & xcode 7,i want to share some information on friend's timeline from my app but when using FBSDK SHARE button only normal share dialog is opening with no option for sharing on friends timeline...i am using following code as per ios9 fbSDK documentation
-(void)shareOnFriendsTimeline
{
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:#"https://www.example.com"];
FBSDKShareButton *shareButton = [[FBSDKShareButton alloc] init];
shareButton.shareContent = content;
shareButton.center = self.view.center;
[self.view addSubview:shareButton];
}
please tell me where i am doing wrong...thanks in advance