我的应用程序建议用户分享一些收集到一个 UIImage 的结果(在应用程序内部到达)(因此这不是具有已知 URL 的图像)
我希望分享者也分享指向某个页面的链接(比如说“stackoverflow.com”)
问题是,如果我向 Controller 添加链接,共享 Controller 不会显示 UIImage(显示页面 Logo 或片段),否则会正确显示没有链接的 UIImage。
我使用 SLComposeViewController,但这不是强制性的。 由于this issue我不能使用 FBSDKShareButton(如果需要的话)。 FBSDKSharingDialog 不接受 UIImages
代码:
//image : UIImage
let fbShareController: SLComposeViewController = SLComposeViewController(forServiceType: SLServiceTypeFacebook)
fbShareController.addImage(image)
fbShareController.addURL(NSURL(string: "www.stackoverflow.com"))
self.presentViewController(fbShareController, animated: true, completion: nil)
这是新的 Facebook 政策,还是我的问题?
感谢您的帮助。
最佳答案
SLComposeViewController
无法满足您的要求。
原因是当您添加图像时,它会作为图像附加到帖子中。但是,当您添加 URL 时,SLComposeViewController 的私有(private)实现(或 Facebook 的后端服务......很难说是哪一个)接管并解析 URL 并提供适当的图像(如果解析 URL 内容后图像可用)以补充链接。 然后,该帖子将成为带有不显示本地附加图像的 URL 的帖子。
关于ios - 是否可以将 UI 图像与指定的链接共享到 FB?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35049521/