Facebook SDK Share链接内容被内容URL中的元数据取代

sop*_*e f 3 facebook ios facebook-sdk-4.0 swift facebook-share

我已经为FBSDKShareLinkContent设置了内容,并设置了每个param contentURL,contentTitle,contentDescription,imageURL.

当共享对话框加载到facebook本机应用程序时,它正确填充了我的参数.

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

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

  // 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)
Run Code Online (Sandbox Code Playgroud)

sop*_*e f 9

想出这个,以防其他人有同样的问题.如果您要共享的URL是iTunes App Store URL,则会一致地发生这种情况.将URL更改为任何其他网站解决了该问题.

https://developers.facebook.com/docs/sharing/ios "注意:如果您的应用程序共享指向iTunes或Google Play商店的链接,我们不会发布您在共享中指定的任何图像或说明.相反,我们发布一些我们直接使用Webcrawler从应用程序商店中搜索的应用程序信息.这可能不包括图像.要预览链接共享到iTunes或Google Play,请在URL调试器中输入您的URL.