【发布时间】:2015-10-18 17:21:38
【问题描述】:
我创建了一个使用 facebook SDK 4.x 的 swift 代码。该代码使用 FBSDKShareButton 并且运行良好。 这是代码:
let content : FBSDKShareLinkContent = FBSDKShareLinkContent()
content.contentURL = NSURL(string: "http://alexandreccarmo.com")
content.contentTitle = "Teste"
content.contentDescription = "teste teste"
content.imageURL = NSURL(string: "xxxx/2.jpg")
let button : FBSDKShareButton = FBSDKShareButton()
button.shareContent = content
button.frame = CGRectMake((UIScreen.mainScreen().bounds.width - 100) * 0.5, 50, 100, 25)
self.view.addSubview(button)
但我需要在不使用 facebook 对话框的情况下分享。当用户单击我的应用程序的按钮时,我需要直接在他们的 Facebook 上分享。 我试过这个:
let contentx : FBSDKShareLinkContent = FBSDKShareLinkContent()
contentx.contentURL = NSURL(string: "http://alexandreccarmo.com")
contentx.contentTitle = "Testexxxxx"
contentx.contentDescription = "teste testexxx"
contentx.imageURL = NSURL(string: "xxxx/2.jpg")
FBSDKShareAPI.shareWithContent(contentx, delegate: nil)
但我收到此错误:
FacebookLogin[6721:3464359] FBSDKLog:警告:[FBSDKAccessToken currentAccessToken] 缺少 publish_actions 权限
我在 facebook 开发人员上读到,当我需要发送共享时,我需要请求“publish_actions”。但我不明白我该怎么做。有人知道吗?
【问题讨论】: