Introduction to Facebook Application Development

From Newscloud

Jump to: navigation, search

In May 2007, Facebook introduced a platform to allow third party developers to write their own applications integrated into the social networking service.

Contents

Facebook Platform Documentation

Facebook Platform Tools

Facebook Platform Resources

  • Google Analytics: Sign up to use statistics tracking from Google in your Facebook application.

Setting Up Your Facebook Application

Image:settings1.jpg

Image:settings2.jpg

Image:EditAbout.jpg

Image:FeedStory.jpg

Tracking Statistics

Image:Stats.jpg

Simple Facebook Example Framework Code

// Copyright 2007 Facebook Corp.  All Rights Reserved. 
// 
// Application: Comedy Central Videos
// File: 'index.php' 
//   This is a sample skeleton for your application. 
// 
require_once 'facebook.php';
$appapikey = 'xxx';
$appsecret = 'xxx';
$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook->require_login();
// Greet the currently logged-in user!
echo "<p>Hello, <fb:name uid=\"$user_id\" useyou=\"false\" />!</p>";
// Print out at most 25 of the logged-in user's friends,
// using the friends.get API method
echo "<p>Friends:";
$friends = $facebook->api_client->friends_get();
$friends = array_slice($friends, 0, 25);
foreach ($friends as $friend) {
 echo "<br>$friend"
}
echo "</p>";

« Back to Education Center home

Personal tools