“已从图API API 2.9弃用”FBSDKShareLinkContent属性的警告

时间:2017-04-21 10:41:52

标签: ios swift fbsdk fbsdksharekit

当我尝试将FBSDKShareLinkContent传递给FBSDKMessageDialog时,会返回一些属性的警告,并说这些属性已从图API API 2.9中弃用。

  不推荐使用

'imageURL':从图API API 2.9中弃用imageURL

     不推荐使用

'contentTitle':从图API API 2.9中弃用contentTitle

     不推荐使用

'contentDescription':从图API API 2.9中弃用contentDescription

为了防止此问题,我该怎么办?

2 个答案:

答案 0 :(得分:11)

允许将链接附加到帖子的方法现在可以从专有meta标记中检索图像,标题和描述,而不是从代码本身检索。只需删除线条即可清除警告并在网站上设置正确的标签。

See the exact deprecation changelog here.

答案 1 :(得分:1)

因此,当您通过Facebook共享链接时,您不再使用这些属性(图2.9)。 Facebook需要的所有信息都将从" og"要分享的网页元标记中的标签(" og:title"等等..)

在您的网络内容元素中,您应该:

<meta property="og:title" content="your content"/>
<meta property="og:description" content="your content"/>