I want to make a facebook app

Discussion in 'Programming' started by andrewp730, Mar 6, 2008.

  1. #1
    I want to make a facebook app and don`t know where to get started.I want to make a flash game.
     
    andrewp730, Mar 6, 2008 IP
  2. Andy Peters

    Andy Peters Peon

    Messages:
    430
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Well download the facebook api client:
    http://developers.facebook.com/clientlibs/facebook-platform.tar.gz

    Create a new folder, and put the client folder from that download in it.

    Go to the facebook developer: http://www.faceook.com/developers
    Set Up A New Application and get your api key and secret key


    Name this file index.php and put your api key and secret key in. Change the path to the swf.
    
    <?
    
    // the facebook client library
    include_once 'client/facebook.php';
    
    $api_key = "";
    $secret = "";
    
    $facebook = new Facebook($api_key, $secret);
    $facebook->require_frame();
    $user = $facebook->require_login();
    ?>
    <fb:swf swfsrc = "http://www.path.to/yourswf" />
    
    PHP:
    Put the index.php in the folder you created. Upload everything.
    Go back to your app in the facebook developer area and set the callback url to the folder that you uploaded including a trailing slash:
    http://www.mywebsite.com/facebookapp/ (example)

    Set the canvas page url to whatever you want.

    Set 'can users add this to their facebook account' to yes

    Set the post add url to the same as the callback url.

    There you have it, a basic facebook app for showing SWFS.

    If you want to put the swf in the profile instead of just showing it:
    index.php
    
    <?
    
    // the facebook client library
    include_once 'client/facebook.php';
    
    $api_key = "";
    $secret = "";
    
    $facebook = new Facebook($api_key, $secret);
    $facebook->require_frame();
    $user = $facebook->require_login();
    ?>
    <fb:swf swfsrc = "http://www.path.to/yourswf" />
    
      $fbml = <<<EndHereDoc
      <fb:swf swfsrc = "http://www.path.to/yourswf"  imgsrc="http://www.path.to/aloadingimage.jpg"/>
    EndHereDoc;
    
    $facebook->api_client->profile_setFBML($fbml, $user);
    
    PHP:
     
    Andy Peters, Mar 6, 2008 IP
    gocubs19 likes this.
  3. lephron

    lephron Active Member

    Messages:
    204
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #3
    lephron, Mar 7, 2008 IP
  4. leen3o

    leen3o Peon

    Messages:
    89
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
  5. andrewp730

    andrewp730 Member

    Messages:
    88
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #5
    Thanks guys i need to figuire out what to make i`m thinking about a game
     
    andrewp730, Mar 8, 2008 IP
  6. andrewp730

    andrewp730 Member

    Messages:
    88
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #6
    I finished making the game,Now i need to implement it.And i need to figure out the scoring.
     
    andrewp730, Mar 14, 2008 IP