DCSIMG
<-- +1 script --> August 2011 - Posts - .Net && Beyond

.Net && Beyond

Taking about .NET and much more

August 2011 - Posts

Get Detailed Notification From Facebook API

Recently I was asked question how to get the image or the comment when using Facebook FQL API to get notification. http://developers.facebook.com/docs/reference/fql/notification/

It is very easy to make an application that will show the basic notification like that looks like:

“David has comment on your link”

“James liked your photo”

You can see more samples at this link: http://www.facebook.com/notifications.php

Well there is no documentation of how to do it (and there is not even a clean way to do it) there is no column that points the the original link\image\comment.

So… do we give up? of course not!

If we will look at the format of the “herf” we will see that there is a param called “story_fbid” (sometimes it is called “fbid” depends on the type of the notification)

http://www.facebook.com/permalink.php?story_fbid=178287412229452&id=100001445838266\

Now all you need to do is take the id and call the graph API https://graph.facebook.com/{ID}?access_token=XZY for more information about the graph API visit (http://developers.facebook.com/docs/reference/api/)

That’s it.

Now you can improve your Facebook notification

 

Keep Writing, Compiling, and Debugging

Alon Nativ

Posted: Aug 08 2011, 12:59 AM by Alon Nativ | with no comments |
תגים:, ,