Stiati ca….

Suma premiilor puse in joc la concursurile anuntate depaseste
75000
de euro ?

Enter your email address:

Categorii

Arhiva

ZeList

Cum sa scrii o aplicatie Facebook

Credeti ca e foarte greu?
Cititi cei 12 pasi descrisi de Kumar Chetan Sharma pe blog-ul LAMP Web Development Blog.

  1. Sign up for Facebook if you don’t have an account. If you can’t do this simple thing do not read further.
  2. Go to Account > Applications and add Facebook Developer application.
  3. Go to the app page, locate and click the “Set up new application” button.
  4. Follow the instructions which let you name your app and set other things.
  5. Dont bother if you dont understand anything in the forms. Fill what you understand and just pay attention to following fields:
    a) Under Canvas > Canvas Page URL, create a Canvas URL which will be your app’s URL on Facebook, for example “my-hello-world-app”

    b) Under Canvas > Canvas Callback URL, this will be URL where we will host our Facebook app, so if I host my app on kumarchetan.com, the URL will be http://www.kumarchetan.com/, easy
    c) Under Canvas > Canvas Settings > Render Method, choose FBML.
    Save changes.

  6. Download the client library from here: http://svn.facebook.com/svnroot/platform/clients/packages/facebook-platform.tar.gz
  7. Extract the library on your local machine and you will end with a folder with two sub folders. We will be using folder named “php”.
  8. Open “index.php” in your choice of editor and you will see following code
    <?php
    // Copyright 2007 Facebook Corp. All Rights Reserved.
    //
    // Application: Ye app puri philmy hai
    // File: 'index.php'
    // This is a sample skeleton for your application.
    //
    require_once 'facebook.php';
    //Your API key
    $appapikey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
    //and your secret ;-)
    $appsecret = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyy';
    $facebook = new Facebook($appapikey, $appsecret);
    // Login is required
    $user_id = $facebook->require_login();

    Delete everything after this code,
    we will simply say “Hello dear” with user name in our app.
  9. Add following
    echo 'Hello <fb:name uid="', $user_id, '" firstnameonly="true" />!';
  10. Upload all the files in php folder to the server which you provided in Canvas Callback URL.
  11. Go to URL http://app.facebook.com/my-hello-world-app, remember “my-hello-world-app” was Canvas URL for our app.
  12. Voila!!! Your app is ready!

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

Acest sit folosește Akismet pentru a reduce spamul. Află cum sunt procesate datele comentariilor tale.