Sunday, October 31, 2010

Facebook fb-req-form howto?

Ive found many misleading website which teach some of the old facebook way of doing things.
There fore, the new example in the facebook php library is the latest concept, where the parameter are passed in via array of keys.

First, setup the namespace into html tag:
<html xmlns:fb="">

Init the page via code in body, somewhere before /body

<div id="fb-root"></div>
window.fbAsyncInit = function() {
appId : '[your_app_id',
session : [php code], // please refer to php example which comes with facebook official library
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML

// whenever the user logs in, we refresh the page
FB.Event.subscribe('auth.login', function() {

(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//';
e.async = true;

You do not need to include the FeatureLoader.js.php. I belief this include is meant for old Facebook api.
Hope this works for you :)
p/s: facebook always change their api, therefore, if it doesnt work, try to google around :)

No comments: