1
試圖通過FBSDKShareLinkContent共享本地圖片,但沒有成功。FBSDKShareContent分享本地圖片
我的示例代碼:
let content: FBSDKShareLinkContent = FBSDKShareLinkContent()
content.contentTitle = "test share"
content.contentURL = NSURL(string: "http://example.com")
let path = NSBundle.mainBundle().pathForResource("testImage", ofType: "png")
content.imageURL = NSURL(string: path!)
let shareDialog = FBSDKShareDialog()
shareDialog.mode = FBSDKShareDialogMode.Native
shareDialog.shareContent = content
shareDialog.fromViewController = self
shareDialog.show()
我理解,但希望使用本地圖片分享,而不是總是從網上下載 – Anton
你上面的代碼是共享的URL,在你不能給本地文件路徑。 – Venkat