I use facebook sdk worked well except for delegate "sharerDidCancel:(id)sharer".
When i cancel my share with native dialog FB app, the delegate "sharer:(id)sharer didCompleteWithResults:(NSDictionary *)results" always called ? So i can't handle my users when they post or cancel the dialog share, is this a bug of Facebook SDK for IOS ?
Thanks for any helping!
The current version of the Facebook SDK for iOS is version 14.1. 0.
The Facebook SDK enables: Facebook Login - Authenticate people with their Facebook credentials. Share and Send dialogs - Enable sharing content from your app to Facebook. App Events - Log events in your application.
The Facebook SDK includes code to access Apple's Advertising Identifier (IDFA), but that code is only executed in certain situations.
I faced same issue during sharing in iOS 11. I have just changed native FB dialog to web dialog. As below:
Use below method:
dialog.mode = FBSDKShareDialogMode.feedWeb
instead of
dialog.mode = FBSDKShareDialogMode.native
Below is my code.It's work fine for me.
let content: FBSDKShareLinkContent = FBSDKShareLinkContent()
content.quote = "My Text"
content.contentURL = NSURL(string: String(format:"My Url"))! as URL!
let dialog: FBSDKShareDialog = FBSDKShareDialog()
dialog.fromViewController = self
dialog.shareContent = content
dialog.delegate = self
dialog.mode = FBSDKShareDialogMode.feedWeb
dialog.show()
I've just been digging through the Facebook SDK docs and found this:
sharer:didCompleteWithResults: when the user successfully shares. Furthermore there will also be a postId key in the results dictionary if the user gave the app publish_actions permissions. If that user has not logged in with Facebook Login, this method will also be called if the user clicks on Cancel.
So, unless you're logged in, checking cancel won't work (which is rubbish). Looks like you might be able to give some permissions and then check the postId though.
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