Facebook share content only shares URL in iOS 9

I was having the same issue, and the workaround I’m using is to set the Share Dialog mode to use the native app.

I’m using Obj-C, but should be pretty much the same in Swift:

FBSDKShareDialog *dialog = [[FBSDKShareDialog alloc] init];
dialog.fromViewController = viewController;
dialog.shareContent = content;
dialog.mode = FBSDKShareDialogModeNative; // if you don't set this before canShow call, canShow would always return YES
if (![dialog canShow]) {
    // fallback presentation when there is no FB app
    dialog.mode = FBSDKShareDialogModeFeedBrowser;
}
[dialog show];

In iOS 9 the user gets the app-switching dialog, but it works fine. There’s also FBSDKShareDialogModeWeb, which doesn’t have the app-switching dialog, but it doesn’t show the image, either.

The default is FBSDKShareDialogModeAutomatic, which chooses FBSDKShareDialogModeShareSheet, which is what you’re seeing.

UPDATE: This is the behavior in iOS9 for the available dialog modes:

  • FBSDKShareDialogModeAutomatic: uses ShareSheet, which is the OP case
  • FBSDKShareDialogModeShareSheet: ditto
  • FBSDKShareDialogModeNative: works if the user has the FB app installed, fails silently otherwise. Presents app-switch dialog.
  • FBSDKShareDialogModeBrowser: shares without image
  • FBSDKShareDialogModeWeb: shares without image
  • FBSDKShareDialogModeFeedBrowser: works as intended
  • FBSDKShareDialogModeFeedWeb: works as intended

“Browser” open Safari full-screen, “Web” opens a webview dialog.

I’d go with either of the last two options for iOS9 and Automatic for iOS8.

Leave a Comment