-
Notifications
You must be signed in to change notification settings - Fork 335
Facebook Share SDK (swift) always return 'success' if user cancel the share dailog. Also if user successfully share the 'LInkShareContent' it return empty dictionary. #171
Comments
I just meet the same issue in Android sdk, can Facebook developers solve the problem? |
ios 11 share always return "cancelled" |
@DisappearPing func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey: Any] = [:]) -> Bool {
SDKApplicationDelegate.shared.application(app, open: url, options: options)
} |
@smahajan28 - I'm in process of closing old issues to help us focus on improving this SDK. If you're still running into this issue, please feel free to reopen this issue. |
@codytwinton I'm unable to open the issue, but I can attest that there are still issues with this flow. Specifically, opening the FB share dialog and sharing a post correctly calls the success statement on the completion callback, however the "postId" is always nil. Furthermore, even if the user doesn't submit the post, success is still returned, making it impossible to validate if a user successfully shared a post. |
@smahajan28 were you able to solve this? |
@smahajan28 @royherma - good to know. I’ll reopen the issue and use it to track progress. In the mean time, if anyone finds a solution, feel free to submit a pull request! |
@codytwinton Do you know if this works for anyone at all on iOS w/ Swift? |
Also, I am using Firebase for my project - perhaps this could be causing issues? |
@royherma - We're in process of resolving the best way to improve this SDK, but I don't believe that Firebase would be conflicting with this SDK. Stay tuned for updates. In the meantime, if anyone finds a solution, feel free to submit a pull request! |
Got it - also, here is my code for reference: let myContent = LinkShareContent(url: kFacebookAppShareURL, title: "Cryptonomy", description: nil, quote: "Cryptonomy is an exclusive social network for crypto-enthusiasts where you can track and discuss everything crypto. It's where crypto happens! \n\nI highly recommend it \(kShareHashTag)", imageURL: nil)
let shareDialog = ShareDialog(content: myContent)
shareDialog.mode = .automatic
shareDialog.failsOnInvalidData = true
shareDialog.completion = { result in
// Handle share results
switch result {
case .success(let response):
if let postId = response.postId {
osPrint("Share succeeded")
logEvent(eventName: "User conversion alert action", attributes: ["action": "Succesfully shared to Facebook", "postId": postId])
self.giveUserReward()
}
break
case .failed(let error):
logEvent(eventName: "User conversion alert action", attributes: ["action": "Failed sharing to Facebook", "error": error.localizedDescription])
self.showErrorAlert(message: error.localizedDescription)
break
case .cancelled:
logEvent(eventName: "User conversion alert action", attributes: ["action": "Cancelled sharing to Facebook"])
break
}
}
do {
try shareDialog.show()
} catch {
//error displaying facebook dialog
} |
@codytwinton any update on this? I haven't been able to get any confirmation that this works for anyone, or that your team reproduced the issue. I have a feature in my app that relies on this flow working correctly (as I imagine many others do), but have yet to get any updates from your team. I wouldn't expect too much but I have always held Facebook to a higher standard! Also, let me know if I can help in any way. Thanks |
@royherma - I apologize for the delay. We'll do our best to get this resolved in the near future. |
@royherma for now, as a workaround, you could use the Objective-C sharing API instead of the swift one. |
@AndrewSB Just tried, same issue - submitting a post returns any empty Using Here is my logic (quite simple): let content = FBSDKShareLinkContent()
content.contentTitle = "This is a test url"
content.contentURL = URL(string:"http://google.com")
FBSDKShareDialog.show(from: self, with: content, delegate: self) Are you able to get different results? |
This leads me to suspect that something in the url callback / app delegate is incorrect or has been changed, resulting in wrong result values (just a hunch) |
@royherma - Thanks for reproducing this with the Objective-C SDK. Since this issue affects that SDK, can you head over here and file a bug? https://developers.facebook.com/support/bugs/ Doing this will ensure that this issue gets resolved in a timely fashion! |
@codytwinton Done - Hoping for a Thanks for staying in the loop. |
@royherma - Ha! |
Always return cancelled result can you help me ? |
The objective-c library actually didn't solve my issue, however after filing a bug on facebook and hearing back, I think the solution is related to making sure the app is question has |
Ok i will try to user_posts permission enabled. |
#171 (comment) using this code and return postid nil how to solve this ? |
@Jignesh1805 - Thanks for adding this in. I'm going to reopen this issue. I'm actively working on some internal improvements to the underlying iOS SDK, which should offer greater stability for this SDK. In the meantime, if anyone finds the the solution to this issue, feel free to submit a pull request. |
getting this issue....... as user just clicks done , without sharing the post it gives a callBack to success and in result field, its not returning anything.... please give the solution |
@codytwinton getting this issue....... as user just clicks done , without sharing the post it gives a callBack to success and in result field, its not returning anything.... please give an ETA for this issue |
@royherma |
After changes to the Graph API last year, this is now the expected behavior. No further information is returned on success. We will update the SDK soon to reflect this. |
@robtimp How to solved this issue ? Which parameter return in success case ? We have need to postId . |
We are using Facebook Share SDK for swift ver 0.2. Whenever we try to share the Link content, we are always getting success in return even if user cancel the operation. Since there are 3 cases: success, cancelled, failed but we are always getting success in this case.
Also if user successfully post the link on his/her wall then we were expecting the post id in the response but again the response is success burt with empty dictionary. We are unable to calculate the number of share user is performing because of the same issue.
API we are using is listed below:
We are using iOS version 10.3.2
Facebook SDK version:
0.2
The text was updated successfully, but these errors were encountered: