Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Graph API : Posting Links / Thumbnail not displaying

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?

like image 265
Anand B Narasimhan Avatar asked Feb 11 '12 03:02

Anand B Narasimhan


1 Answers

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.

like image 169
Jeyara Avatar answered Oct 03 '22 11:10

Jeyara