Facebook Graph API : Posting Links / Thumbnail not displaying

守給你的承諾、 提交于 2020-01-13 10:33:52

问题


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:

  1. Generate a unique key
  2. Store in DB
  3. Post the link to Facebook with the meta tags etc.

What am I missing?


回答1:


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.




回答2:


If you still have problems with thumbnail when publishing link, you should try to change your CDN service or try to experiment with its settings. It was a helpful decision after several months with such problem. btw, my mate's another project had identical problem either and changing CDN also helped. It was cloudflare service.



来源:https://stackoverflow.com/questions/9237525/facebook-graph-api-posting-links-thumbnail-not-displaying

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