Facebook Application Development: Part 2

Facebook Application Development: Facebook is now the new face of web world and facebook applications are making the user engaged and interact with various developers and companies. Their countless use of facebook application other than this, so why not learn Facebook Application Development.I think you all have learnt enough about “how to set up an Facebook Application” from my previous post.If you havn’t read it please first go through it.

http://abhisheksrivastava.in/facebook-application-development-part-1

Lets Start with a step by step Facebook Tutorial Part 2.

After reading this article you will learn the following:

How to install Facebook Client Library for you Facebook Application

How to print “Hello World”  in Facebook Application canvas

I am writing this artile by assuming that you know “How to setup facebook application“.I will use the terms from the last tutorial.

(Click on image to view in large)

STEP 1:Sign in to your facebook account and go to url

http://www.facebook.com/developers .

Step 2:Click on the “Testing Application” (your application name) in “My Applications”  side menu

Step 3:Now in the bottom left you will find “Download the Client Library”  click and download it from here and save to ypur PC.

set-up-step-6

Step 4:Open your ftp account of your webspace and go to the folder testingapp (this folder is set as root folder in previous tutorial)

Step 5:Upload the client library folder in it.Don’t forget to extract if zipped.

Step 6:Create a file with name index.php in  the testingapp folder and write down the following code:

<?php
//  client library main folder is facebook-0.1.0 here
include 'facebook-0.1.0/facebook-0.1.0/facebook.php';
$appapikey = 'XXXXXXXXXXXXXXXXXXXXXXXXXX';
$appsecret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
// creating $facebook class for accesing various facebook tag
$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook->require_login();
echo "Hello World";
?>
<br/>
Hi <fb:name uid="<?php echo $user_id;?>" />!

Step 7:Go to the canvasurl and see hello world and your name ;)

Try Now..

Wait for the next post

Upcoming Part Contains:

Why and How require_login() and some important Facebook API tags with proper usage.

Have a look on our Facebook Application Demo :

http://apps.facebook.com/betonit 
http://apps.facebook.com/testpolly 
http://apps.facebook.com/pollonfb 
http://apps.facebook.com/hitstatus 
http://apps.facebook.com/tshirtquote
http://apps.facebook.com/diwaligifts

Leave a Reply

Your email address will not be published. Required fields are marked *