Facebook Graph API:发布链接/缩略图不显示 [英] Facebook Graph API : Posting Links / Thumbnail not displaying
问题描述
以下是一个示例URL: http://barcodegen.herokuapp.com/coupon?couponId=8f9436f6-f1b3-42ec-900c-be45305e1aa6
我已经运行它了。 http: //developers.facebook.com/tools/debug/og/object?q ,并没有报告任何错误,并按预期显示缩略图。
当我粘贴在Facebook上的链接direclty似乎检测元标记,但当我发布链接从我的服务器端Java应用程序,它似乎没有检测到是正确的。这是我的服务器端应用程序所做的工作:
- 生成唯一键
- li>
- 使用元标签等向Facebook发布链接。
我缺少什么? p>
我希望您将访问令牌作为唯一密钥。
有同样的问题。我解决如下。我正在使用 C#Facebook SDK 。但我希望你能得到这个想法。
Dim fb As FacebookClient = New FacebookClient('access_token')
/ pre>
Dim args As Dictionary(Of String,Object)=新词典(Of String,Object)()
args(message)=要发布的消息
args (link)=http://www.example.com
fb.Post(/ me / feed,args)
然后Facebook自动提取预览图像,其他元数据并自行发布。
I'm posting a link through the Facebook Graph API. I see the link but the thumbnail image is not appearing as expected.
Here's an example URL: http://barcodegen.herokuapp.com/coupon?couponId=8f9436f6-f1b3-42ec-900c-be45305e1aa6
I've run it throigh http://developers.facebook.com/tools/debug/og/object?q and that does'nt report any errors and displays the thumbnail image as expected.
When I paste the link direclty on facebook it seems to detect the meta tags but when I post the link from my server side Java app, it does'nt seem to detect is correctly. Here's what my server side app does:
- Generate a unique key
- Store in DB
- Post the link to Facebook with the meta tags etc.
What am I missing?
解决方案I hope you mean access token as the unique key.
I had same issue. I solve as following. I was using C# Facebook SDK. But i hope you can get the idea.
Dim fb As FacebookClient = New FacebookClient('access_token') Dim args As Dictionary(Of String, Object) = New Dictionary(Of String, Object)() args("message") = "Message to be posted" args("link") = "http://www.example.com" fb.Post("/me/feed", args)
Then Facebook automatically fetches preview image, other meta data and post it self.
这篇关于Facebook Graph API:发布链接/缩略图不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!