除了委托(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/