IOS Facebook SDK : what wrong with sharerDidCancel:(id<FBSDKSharing>)sharer delegate?

标签 ios xcode facebook delegates

除了委托(delegate)“sharerDidCancel:(id)sharer”,我使用的 facebook sdk 运行良好。

当我取消与 native 对话框 FB 应用程序的共享时,委托(delegate)“sharer:(id)sharer didCompleteWithResults:(NSDictionary *)results”总是被调用?所以当我的用户发布或取消对话框共享时我无法处理,这是 Facebook SDK for IOS 的错误吗?

感谢您的帮助!

最佳答案

我在 iOS 11 中共享时遇到了同样的问题。我刚刚将原生 FB 对话框更改为 Web 对话框。如下:

使用以下方法:

dialog.mode = FBSDKShareDialogMode.feedWeb

代替

dialog.mode = FBSDKShareDialogMode.native

下面是我的代码。它对我来说工作正常。

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()

关于IOS Facebook SDK : what wrong with sharerDidCancel:(id<FBSDKSharing>)sharer delegate?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30185742/

相关文章:

iphone - 防止应用程序崩溃

iOS 如何绘制带轮廓的线条

ios - UICollectionView 的单元格消失

xcode - MAS : Code Signing Identity Private Key

php - Facebook 登录 : Which parameter should my app identify the user with? id,或电子邮件?

ios - 如何在 iOS 项目中使用 HDR 颜色?

ios - 如何使用 Swift 和 Firebase 在我的数据库中搜索特定项目?

ios - 客户端应用程序的 iPhone App Store ID

facebook - 无法使用 Facebook API 和 Graph 显示 Facebook 用户头像

ios - RealmSwift 查询中带有内部对象引用的谓词问题