Facebook SDK共享链接内容由内容URL中的元数据替代 [英] Facebook SDK Share Link content gets replaced by meta data from content URL

查看:226
本文介绍了Facebook SDK共享链接内容由内容URL中的元数据替代的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为FBSDKShareLinkContent设置了内容,并设置了每个参数contentURL,contentTitle,contentDescription,imageURL。

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

当在Facebook本机应用程序中加载共享对话框时,使用我的参数

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

但是,一旦我在Facebook上查看帖子,param 数据不再显示,而是标题来自contentURL的元数据。

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.

如何使用contentDescription和contentTitle覆盖元数据?
谢谢!

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)


推荐答案

如果有人有同样的问题,就想出来。
如果您共享的URL是iTunes App Store URL,则会一直发生。将URL更改为任何其他网站解决了这个问题。

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
注意:如果您的应用程序共享链接到iTunes或Google Play商店,我们不会发布任何图片或说明您在共享中指定的,而是直接从Webcrawler发布一些应用程序信息,这可能不包括图像。要预览链接共享到iTunes或Google Play,请在URL调试器中输入您的URL。

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."

这篇关于Facebook SDK共享链接内容由内容URL中的元数据替代的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆