Getting your game on Facebook the easy way


What’s necessary for putting a flash game on facebook? Not much. I did that by putting a php file onto my server which acts as the canvas file. Into the same folder I unpacked the FB PHP SDK. FB likes developers and thus gives you an application profile page, the only thing you have to worry about is the actual canvas page.

To create an app for TriPop I followed the normal procedure, added an app in the developer section, copied the given keys, created the php file, filled out several, mostly self explaining, fields including the path to my file and there it is. TriPop’s application profile page and the TriPop application itself.

The FB SDK, once unpacked needs to go onto the server to as the php will refer to it.

The code for a simple application canvas (no approval by the user required because no user data is used) looks like this:

// Awesome Facebook Application
// Name: Application Name

require_once 'facebook-php-sdk/src/facebook.php';

// Create our Application instance.
$facebook = new Facebook(array(
  'appId' => '***************',
  'secret' => '********************************',
  'cookie' => false,


<div style = " text-align: right; width: 640px; margin-bottom: 5px; ">
	Back to
	's application page

<div style = " text-align: center; width: 640px; margin-bottom: 5px; ">
		width='640' height='480'

The first div is just for a text field at the top that can be used as a back button to the application profile page. The next div encloses the swf. And that is all. Really…

For more information refer to the FB Developer Documentation. Just if you need to go deeper or if you want to use more functions. Moreover, for dedicated development on the FB platform you may want to have a look at Michael’s new book.

This entry was posted in mochiads, monetization, Tutorial and tagged , , . Bookmark the permalink.

Comments are closed.