问题
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?
回答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