Pages

Sunday, February 01, 2009

Showing up Google Adds on your Facebook Application
Its about facebook & google. I was trying to show few google adds on my Facebook app.

The code is very simple.. Just the Google Add scriptlet and then the Sample PHP code from facebook developer. In a whole it looks like below.





// Copyright 2007 Facebook Corp.  All Rights Reserved.
//
// Application: nothing
// File: 'index.php'
//   This is a sample skeleton for your application.
//
echo "This is my FB app";
require_once '/home/da2642e0/facebook/facebook-platform/client/facebook.php';


$appapikey = 'Your App ID';
$appsecret = 'The secret Key';
/*$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook->require_login();


// Greet the currently logged-in user!
echo "
Hello, !
";


// Print out at most 25 of the logged-in user's friends,
// using the friends.get API method
echo "
Friends:";
$friends = $facebook->api_client->friends_get();
$friends = array_slice($friends, 0, 25);
foreach ($friends as $friend) {
  echo "
$friend";

}
echo "
";
?>


Of course this was not working, that is why I am blogging. 
Here is a very silly problem. Oh dont worry the problem is not in the code.
It is a FB app settings related issue. I dont know very clearly but it worked in my case, When I selected the IFrame instead  of FBML..  Look @ the image below.







No comments:

Post a Comment