Just recently my standard sharing-code was working as expected. When the user cancelled a Facebook share, the SLComposeViewController.completionHandler returned SLComposeViewControllerResult.Cancelled
Now however, after updates made by Apple or Facebook (the changes include a new design for the compose view), the completionHandler always gets the result Done.
I get the same behaviour on:
Anybody else have the same problem? Below is my code:
let fbComposeViewController = SLComposeViewController(forServiceType: SLServiceTypeFacebook)
fbComposeViewController.addURL( NSURL(string:"http://www.some.url.com/)"))
fbComposeViewController.completionHandler = { (result:SLComposeViewControllerResult) -> Void in
switch result {
case SLComposeViewControllerResult.Cancelled:
print("Cancelled") // Never gets called
break
case SLComposeViewControllerResult.Done:
print("Done")
break
}
}
self.presentViewController(fbComposeViewController, animated: true) {
}
Do you have the Facebook app installed when you are testing this? If not, that can explain this behaviour. See also this comment: https://developers.facebook.com/bugs/608854599254853/?comment_id=565037930316792
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With