Facebook SDK Share Link content gets replaced by meta data from content URL

早过忘川 提交于 2019-12-06 10:26:16

问题


I've set up content for FBSDKShareLinkContent, and set each param contentURL, contentTitle, contentDescription, imageURL.

When the share dialog loads in the facebook native app, it is correctly populated with my params.

However, once I check the post on facebook, the param data is no longer shown and instead the post title is from the meta data of the contentURL.

How do I override the meta data with my contentDescription and contentTitle? Thanks!

  // Assemble Content
    var content: FBSDKShareLinkContent = FBSDKShareLinkContent()
    content.contentURL =  NSURL(string: DOWNLOAD_LINK_APPSTORE)
    content.contentTitle = "My Custom Title"
    content.contentDescription = "My Custom Description"
    content.imageURL = NSURL(string: FB_IMAGE_LINK)
   // Share Dialog
    FBSDKShareDialog.showFromViewController(self, withContent: content, delegate: nil)

回答1:


Figured this out in case anyone else has the same problem. This occurs consistently if the URL you are sharing is an iTunes App Store URL. Changing the URL to any other website solved the problem.

https://developers.facebook.com/docs/sharing/ios "Note: If your app share links to the iTunes or Google Play stores, we do not post any images or descriptions that you specify in the share. Instead we post some app information we scrape from the app store directly with the Webcrawler. This may not include images. To preview a link share to iTunes or Google Play, enter your URL into the URL Debugger."



来源:https://stackoverflow.com/questions/30742645/facebook-sdk-share-link-content-gets-replaced-by-meta-data-from-content-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!