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.

login/out and requesting permissions, posting to a user’s wall, getting a user’s information all with graph api, newest api
methods for login/logout
what to show depends on result of
You should also authorize your app using the values from you facebook developer app page
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);
info, how to load sdk
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 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:
can trigger dialogs with ui methods
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

No comments:

Post a Comment