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.
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.
<?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>
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.
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?