facebook-ios-sdk
facebook-ios-sdk copied to clipboard
SharingDelegate receives didCompleteWithResults callback if sharing is aborted in native mode
Checklist before submitting a bug report
- [X] I've updated to the latest released version of the SDK
- [X] I've searched for existing GitHub issues
- [X] I've looked for existing answers on Stack Overflow, the Facebook Developer Community Forum and the Facebook Developers Group
- [X] I've read the Code of Conduct
- [X] This issue is not security related and can safely be disclosed publicly on GitHub
Xcode version
15.0.1
Facebook iOS SDK version
16.2.1
Dependency Manager
SPM
SDK Framework
Share
Goals
I'd like to receive SharingDelegate's sharerDidCancel(_ sharer: FBSDKShareKit.Sharing) callback instead of sharer(_ sharer: Sharing, didCompleteWithResults results: [String : Any]), if the user aborted sharing inside the Facebook app (tapped cross in top left corner and Discard in alert). Otherwise there's no way to tell sharing cancellation from successful sharing from the original app given that results dictionary is always empty.
It's important since this bug might be a good incentive for fraudulent actions in referral mechanics within the app's business model (e.g. giving rewards for sharing content on Facebook)
Expected results
SharingDelegate's sharerDidCancel(_ sharer: FBSDKShareKit.Sharing) callback called if sharing is aborted
Actual results
SharingDelegate's sharer(_ sharer: Sharing, didCompleteWithResults results: [String : Any]) callback called if sharing is aborted
Steps to reproduce
- Using Facebook SDK prepare sharing flow similar to this:
let dialog = ShareDialog(
viewController: controller,
content: shareContent,
delegate: controller
)
dialog.mode = .native
dialog.show()
where controller is a UIViewController that implements SharingDelegate methods and shareContent is some share content e.g. ShareLinkContent
- When routed to Facebook app tap cross in top left corner to abort the sharing flow and then tap Dismiss in system confirmation alert
- In SharingDelegate's methods the
didCompleteWithResultscallback will be called
Code samples & details
No response