我的应用程序中有一个按钮,当我点击它时,它会调用这个功能来将UIImage分享给facebook,但它不起作用。我遵循了facebook的文档,我不知道为什么它不能工作。这是我的代码
func shareImage(image: UIImage) {
let photo = Photo(image: image!, userGenerated: true)
let content = PhotoShareContent(photos: [photo])
try! ShareDialog.show(from: self, content: content)
}你能帮帮我吗。谢谢。
发布于 2018-04-06 05:36:31
我已经成功地用这个link与Facebook分享了内容。
let vc = SLComposeViewController(forServiceType:SLServiceTypeFacebook)
vc.add(image)
vc.add(URL(string: "http://www.example.com/")) // optional
vc.setInitialText("Initial text here.")
self.present(vc, animated: true, completion: nil)https://stackoverflow.com/questions/49681752
复制相似问题