【发布时间】:2015-10-22 20:54:16
【问题描述】:
我是 iOS 新手,我想分享一个使用 Facebook SDK for iOS 的链接。我的代码如下:
@IBAction func shareVoucherUsingFacebook(sender: UIButton) {
print("Facebook")
let content : FBSDKShareLinkContent = FBSDKShareLinkContent()
content.contentURL = NSURL(string: "www.google.com")
content.contentTitle = "Content Title"
content.contentDescription = "This is the description"
let shareDialog: FBSDKShareDialog = FBSDKShareDialog()
shareDialog.shareContent = content
shareDialog.delegate = self
shareDialog.fromViewController = self
shareDialog.show()
}
我也实现了FBSDKSharingDelegate方法,但是当我按下这个按钮时我无法接收到共享对话框,并且方法func sharer(sharer: FBSDKSharing!, didFailWithError error: NSError!)正在执行,这意味着出了点问题,但我可以'想不通。
提前致谢。
【问题讨论】:
-
您找到解决方案了吗?我现在遇到了同样的问题...
标签: ios swift swift2 facebook-sdk-4.0