Monday, October 3, 2011

PHP and JS Guidlines for FB: Acronyms!

I've put together a guide on the php and javascript sdks for facebook. It mostly consists of links to facebook's own documentation, which is amazing. This needs to be cleaned up, but these links show examples on pretty much every part of facebook's api.


php:
login/out and requesting permissions, posting to a user’s wall, getting a user’s information all with graph api, newest api http://developers.facebook.com/docs/reference/php/facebook-api/
methods for login/logout http://developers.facebook.com/docs/reference/php/facebook-getLoginUrl/ http://developers.facebook.com/docs/reference/php/facebook-getLogoutUrl/
what to show depends on result of http://developers.facebook.com/docs/reference/php/facebook-getUser/
You should also authorize your app using the values from you facebook developer app page http://developers.facebook.com/docs/reference/php/facebook-setAppId/ http://developers.facebook.com/docs/reference/php/facebook-setAppSecret/
i dont see it in the docs explicitly but in the examples this method is used to init facebook object:
$config = array( 'appId' => 'YOUR_APP_ID', 'secret' => 'YOUR_APP_SECRET', );
$facebook = new Facebook($config);
javascript
info, how to load sdk http://developers.facebook.com/docs/reference/javascript/
FB.login() -- login and/or request extended permissions FB.logout() -- logout (only if the user is connected with your application) FB.getLoginStatus() -- get current login status from facebook.com FB.getSession() -- synchronous accessor for the current session. Note that in OAuth 2.0, this function will no longer function and you should use FB.getAuthResponse(). FB.getAuthResponse() -- accessor for the current authorization response record, which for connected users includes an access token, a signed request, and a user ID.
api calls: http://developers.facebook.com/docs/reference/javascript/FB.api/
can trigger dialogs with ui methods http://developers.facebook.com/docs/reference/javascript/FB.ui/
lots of useful methods - can control position, size, etc for canvas page, login/out, etc
you can make calls in facebook query language to get info http://developers.facebook.com/docs/reference/fql/

No comments:

Post a Comment