Search code examples
iosobjective-cfacebook-ios-sdkfacebook-sdk-4.x

encounter "Web share dialogs cannot include photos" error in Facebook iOS SDK 4.10.0


I am using Facebook iOS SDK 4.10.0 to share a photo FBSDKSharePhotoContent using the following code:

FBSDKShareDialog *dialog = [[FBSDKShareDialog alloc] init];
dialog.fromViewController = self;
dialog.shareContent = content;
dialog.delegate = self;
dialog.mode = FBSDKShareDialogModeBrowser;
[dialog show];

but I encounter the error:

Error Domain=com.facebook.sdk.share Code=2 "(null)"
UserInfo={com.facebook.sdk:FBSDKErrorArgumentValueKey=<FBSDKSharePhotoContent: 0x14609d580>, com.facebook.sdk:FBSDKErrorDeveloperMessageKey=Web share dialogs cannot include photos., com.facebook.sdk:FBSDKErrorArgumentNameKey=shareContent}

May I know the cause of the error and how should I resolve it?


Solution

  • Feed share dialogs support FBSDKShareLinkContent

    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