4

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];
Eric Conner
  • 10,422
  • 6
  • 51
  • 67

1 Answers1

1

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];
User511
  • 1,456
  • 10
  • 28