Facebook App Development

Status
Not open for further replies.

a!!!!1

Banned
Apr 20, 2008
508
7
0
Does anyone know if Facebook apps are just pure flash, or if there are specific "Facebook codes" that need to be used? Also, if I have an app designed for Facebook, can it also be used for Myspace, or would it need lots of tweaking? Thanks.
 


Facebook apps are written in a language of your choice. Most commonly PHP. The output of the app has to contain special Facebook markup (FBML) to display certain interface elements (like the persons name, or an invite form).
 
Yes facebook apps can be developed in numerous languages, and there is a standard facebook API, to interact with the website and the users.
 
Thanks for the info. My app is a flash game so I don't think there would be any PHP involved (?) but I just wanted to make sure FB didn't have a bunch of crazy stuff you had to do to it.
 
Thanks for the info. My app is a flash game so I don't think there would be any PHP involved (?) but I just wanted to make sure FB didn't have a bunch of crazy stuff you had to do to it.

Well PHP or JS at the very least would be needed if you intend to collect any information from facebook about the user such as their profile name and so forth. Remember flash isn't just an .swf it gets contained inside of a page usually html, or a .php document (which outputs as html).

For your purposes you'll want to use the iframe method more than likely, since I don't think you can do a fb markup to embed an offsite flash applet, especially if you plan on not taking anything in bout the user's profile and such via parameters.
 
Well PHP or JS at the very least would be needed if you intend to collect any information from facebook about the user such as their profile name and so forth. Remember flash isn't just an .swf it gets contained inside of a page usually html, or a .php document (which outputs as html).

For your purposes you'll want to use the iframe method more than likely, since I don't think you can do a fb markup to embed an offsite flash applet, especially if you plan on not taking anything in bout the user's profile and such via parameters.

Players have in-game usernames that are saved and used every time they play the game, similar to xbox live gamertags. The usernames are associated with their FB profile so the only way to play under their username is to login through the FB profile they were logged into when they created that username.

Also, I want to have a FB profile tab so their friends can see their high scores and a few other values ... as well as notifications that are sent out when they are playing, or they achieve a high score.
 
Players have in-game usernames that are saved and used every time they play the game, similar to xbox live gamertags. The usernames are associated with their FB profile so the only way to play under their username is to login through the FB profile they were logged into when they created that username.

Also, I want to have a FB profile tab so their friends can see their high scores and a few other values ... as well as notifications that are sent out when they are playing, or they achieve a high score.

Basically then yes you would have to use PHP or something the facebook library has API support for in order to require login and to obtain and store the user values.

For example in the php, this is the footprint exampel they provide starting developers...

Code:
<?php

// the facebook client library
include_once '../php/facebook.php';

// some basic library functions
include_once 'lib.php';

// this defines some of your basic setup
include_once 'config.php';

$facebook = new Facebook($api_key, $secret);
$facebook->require_frame();
$user = $facebook->require_login();

if (isset($_POST['to'])) {
  $prints_id = (int)$_POST['to'];
  $prints = do_step($user, $prints_id);
} else {
  if (isset($_GET['to'])) {
    $prints_id = (int)$_GET['to'];
  } else {
    $prints_id = $user;
  }
  $prints = get_prints($prints_id);
}

?>
<div style="padding: 10px;">
  <h2>Hi <fb:name firstnameonly="true" uid="<?=$user?>" useyou="false"/>!</h2><br/>
  <a href="<?= $facebook->get_add_url() ?>">Put Footprints in your profile</a>, if you haven't already!
    <form method="post" >
<?php
      if ($prints_id != $user) {
        echo 'Do you want to step on <fb:name uid="' . $prints_id . '"/>?';
        echo '<input type="hidden" name="to" value="' . $prints_id . '"/>';
      } else {
        echo '<br/>Step on a friend:';
        echo '<fb:friend-selector idname="to"/>';
      }
?>
      <input value="step" type="submit"/>
    </form>
  <hr/>
  These are <fb:name uid="<?= $prints_id ?>" possessive="true"/> Footprints:<br/>
  <?php echo render_prints($prints, 10); ?>
  <div style="clear: both;"/>
</div>

If you note how the $user is loaded after its been confirmed they logged in you can then pass the user's value to the flash applet either via storage into your database, or as a parameter. Either way your flash, database, data files and such lives on your server, but you need to use the FB API in order to interact with facebook's information. And I don't recall to my knowledge if there's any API or way easily known for actionscript developers to do so directly.
 
I also wanted to track the number of friends a user has invited to the game (if it's too hard to track number actually joined, tracking the number invited regardless of whether they joined or not would suffice) and then reward users for inviting a specific number of people, say 100. Is there a way to do this?
 
No, you can't get the number of friends they've invited. Facebook really doesn't like apps that contain an incentive to invite their friends to use the app.
 
No, you can't get the number of friends they've invited. Facebook really doesn't like apps that contain an incentive to invite their friends to use the app.

:P The general rule of thumb is that an app can observe information strictly about the person installing the app with their permission (ie: that big ass dialog that pops up saying such and such app wants to access such and such info).

The limit of course is when it starts to get info about others, who haven't yet given permission to the app to view their info. So at best you get their name, user id, and stuff that may allow you to create a database entry specifically for them. But not anyone past them.

App invites least the "Face book" way has to be done by the user and not the app itself.
 
Furthermore, if your app displays the invitation form on two page requests in a row, Facebook adds a "Report forced invites" link below the form.
 
I'm not trying to force it, rather, one aspect of the game is "achievements" that users earn for completing certain in-game tasks, and I wanted to throw "invite 100 friends to this app" in there. I'm not trying to collect names or anything, I'd just like to be able to save a value for the number of invitations sent out, and then when it hits 100, give them credit for that achievement. Can't be done?
 
I'm not trying to force it, rather, one aspect of the game is "achievements" that users earn for completing certain in-game tasks, and I wanted to throw "invite 100 friends to this app" in there. I'm not trying to collect names or anything, I'd just like to be able to save a value for the number of invitations sent out, and then when it hits 100, give them credit for that achievement. Can't be done?

I think (and maybe audax knows more about this) that when someone invites someone thru the app you could simply add that name to your database, and then when that person with that user id installs the app, you can then update the database to mark that as a completed acheivement.

So basically at each login you could have the app check the database for user's invite count. Course this may be a tad difficult for you, if flash is the only thing you know how to program (even more so if you don't know actionscript).
 
Status
Not open for further replies.