Search code examples
iosfacebook-graph-apifacebook-share

Facebook SharePhoto dialog does't show in swift 4


FBSDKSharingDelegate

let FBImage = FBSDKSharePhoto()

FBImage.image = snap
FBImage.isUserGenerated = true

let content = FBSDKSharePhotoContent()
content.photos = [FBImage]
let dialog = FBSDKShareDialog()
dialog.mode = .automatic
dialog.delegate = self
dialog.fromViewController = self
dialog.shareContent = content

if dialog.canShow(){
   dialog.show()
 }

// Facebook Auth Permission

FBSDKGraphRequest(graphPath: "me", parameters: ["fields":"id,name,first_name,email,birthday"]).start(completionHandler: { (connection, result, error) in })

-canOpenURL: failed for URL: "fbauth2:/" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"


Solution

  • Install Facebook Application in your Mobile.

    enter image description here

    I have Not error But Application not install in my mobile so don't open dialog box.