Hacker News new | ask | show | jobs
by txt 5765 days ago
I actually enjoy working with facebook's open graph api, BUT Using the PHP & JS SDK is a nightmare. I wrote my own class in PHP using curl, all data is returned in JSON which for me makes things simple. Retrieving the access token and authenticating each user can be handled a number of ways. Ever since they updated there policies, you are now allowed to store all of the users info once they allow your "application". I've seen alot of people complain when they use the new SDK's, but I see no reason to go that route...I think the best way whether it be a application,fan page, or external site is to present your app first, let the user actually see it and not FORCE them to allow it (which 90% of most apps do)...Once they peform a action, either redirect/ or popup/iframe to the authorization url;. I use the 'offline' permission so the access token for each user doesn't expire. Once they allow it, pull any info you want by a simple curl request, then store all there info(including access token) in your DB. Simple as that! There are only a few things I dislike, there like/comment buttons, and how you are limited to using either there iframe or xfbml (which is still an iframe).