facebook-ios-sdk icon indicating copy to clipboard operation
facebook-ios-sdk copied to clipboard

SharingDelegate receives didCompleteWithResults callback if sharing is aborted in native mode

Open stepanovgena opened this issue 2 years ago • 0 comments
trafficstars

Checklist before submitting a bug report

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

  1. 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

  1. When routed to Facebook app tap cross in top left corner to abort the sharing flow and then tap Dismiss in system confirmation alert
  2. In SharingDelegate's methods the didCompleteWithResults callback will be called

Code samples & details

No response

stepanovgena avatar Nov 13 '23 12:11 stepanovgena