Apps on

By | May 11, 2011
Hello everyone I’m here to discuss about how to build a Facebook App. Facebook has millions of user with it and developing an app on Facebook gets you opportunity to deeply integrate into the core Facebook experience. An app developed on Facebook can integrate with many aspects of, including the News Feed and Notifications. Apps on Facebook are the web apps that are loaded in context of Facebook. And a web app can we developed by any of the available languages, the further Blog is based on php.

The apps on facebook are canvas based, we have a canvas (or iframe) in which we load our app.
Suppose the url to your app is then the app url will be (i.e. this url will load the contents of your original app link).Before getting into anything lets know the size of canvas so that we can build our app efficiently.  
760px (width) – if you build your app on a full app page, and
520px (width) – if you embed your app on a page in

Facebook Integration

Firstly you need to goto Developer App click on Set Up a New App, further you will be asked to enter the name of your app, do it and proceed, cross the security checks and all and doing all that you will be redirected to a page where you need to enter the basic information about your app and this page will also contain the tab Facebook Integration. Under this tab you will get your app_id and app_secret, you need to note these two because they will be used further in your app. Your canvas url gets integrated to facebook now what you need to do is start developing your app.

I can’t give you an idea of what an app to develop, so am just proceeding with how to use the facebook pre-defined functions in your app and access the user information. You need a facebook.php, which contains all the required pre-defined functions to be used. A sample code to use these functions and access user information on Facebook is –


// Awesome Facebook Application ( ‘facebook.php’;
// Create our Application instance.$facebook = new Facebook(array(  ‘appId’ => ‘your_app_id‘,  ‘secret’ => ‘your_app_secret‘,  ‘cookie’ => true,));
    $app_id = “your_app_id”;    $app_secret = ‘your_app_secret’;    $canvas_page = “your_canvas_url”;    $auth_url = “” . $app_id . “&redirect_uri=” . urlencode($canvas_page);    $code = $_REQUEST[“code”];    $token_url = “”.$app_id.”&redirect_uri=”. urlencode($canvas_page).”&client_secret=”.$app_secret.”&code=”.$code;       if (empty($code)) {echo(“<script> top.location.href='” . $auth_url . “‘</script>”);}        $access_token = file_get_contents($token_url);        $user_data_url = “”.$access_token;        $user = json_decode(file_get_contents($user_data_url));
echo(“Username:” . $user->name);
echo(“Email” . $user->email);

The above code will fetch user-name on and his email-id, you can use this code for your app and further modify it, there are multiple ways to do it but i find it the simplest. This would be the starting or basic step of your Facebook app use this and get a burning idea for your app and show your programming skills and get your app working on

Hope your find it useful… hope to see your app soon… šŸ™‚

4 thoughts on “Apps on

  1. Pingback: PraveenTech TechBits » What is Google+

  2. Maryrose Loberg

    I simply want to say I’m newbie to blogs and seriously enjoyed you’re blog site. Probably Iā€™m going to bookmark your site . You certainly have excellent articles and reviews. Bless you for sharing with us your web site.

  3. mirasandover

    Wow, this piece of writing is pleasant, my younger sister is analyzing these kinds
    of things, therefore I am going to let know her.


Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.