How to Build a Facebook App For Your Page

You want to create a Facebook App, but don’t know where to start? Or you have heard about Facebook Apps, but don’t even know what they are. Facebook Apps are everywhere on the site, and most of the more common ones are actually written by Facebook’s own developers. Photos, Events, and many other “core” features of Facebook are actually separate apps. And there are thousands of other third-party apps available for installation into your personal Facebook account.

What is an App?

Notice I said “installation” and not “download”. An “App” (Not to be confused with the similarly not-quite-a-full-application called an “Applet”) is not really an “application” – which would be familiar to Mac users and just a word to Windows users, but “applications” and “programs” are roughly synonymous to each other as what software is called on a personal computer. They are installed from disk or downloaded, but either way, they actually get written onto your hard drive. An App doesn’t. It’s a feature to a website that goes no further than your browser. So if you were using an App to play Scrabble with a friend on Facebook, each move you make is saved on Facebook’s servers, not the computers of you or your friend. And the page updates when you log in again or otherwise refresh your browser. This is the core of what makes something an “app”.

What is the Facebook Platform?

Facebook launched the Facebook Platform on May 24, 2007, providing a framework for software developers to create applications that interact with core Facebook features. User information can be shared from web communities to outside applications, delivering new functionality to the web community that shares its user data via an open API.

An API is an application programming interface which is a specification intended to be used as an interface by software components to communicate with each other. In fact, the Facebook Application Platform is one of the best-known APIs. The Facebook Platform provides a set of APIs and tools, which enable third-party developers to integrate with the "open graph" — whether through applications on Facebook.com or external websites and devices.

Why Do You Want a Facebook App?

What can your business use a game like Scrabble for? Very little, but games, while exceptionally popular, are not the only use of apps. They can be used by any entity that wants its name shared in a social media sphere. Think of the common complaint of some people posting mundane “tuna salad sandwich for lunch” status updates. And think of the Facebook page you created for the restaurant you own. It’s pretty popular, but there doesn’t seem to be that many regular customers “liking” the page on Facebook. Now imagine the page having an app where menu items with very nice, tantalizing images are selectable and shareable. Instead of a boring status update or a mere link to your page, with a phone number and address, an app can let that user share in their news feed a more eye-catching way of what they just ate in your restaurant.

And users will be more inclined to click on the picture than just normal blue linked text. And the app user barely has to do anything. Since they already allowed the app to share to their profile, it’s even simpler than typing out the sentence of what they ate. If you are looking for ideas or inspiration of what Facebook app you should build, browse the Facebook App Center.

How to Get Started Building an App

To get started, you must have a Facebook account. Use your personal Facebook account to create a Facebook page for your business or organization. Your personal information is safe and does not get tied to the page if you don’t want the “creator” to be known publicly, but Facebook insists on all pages being created by people and not from the companies themselves from the get-go.

The first step in writing an App is getting an App. With your existing Facebook account, add the Developer application to your Facebook profile and then click “Set Up New Application”. Then simply get through the tasks of naming it, agreeing to some standard Terms of Service, and upload an image for its logo (You can change it later).

You don’t have to be a “geek” for writing basic Facebook Applications. You will need some very basic knowledge of web programming languages and some free space on a web server where you’ll host your Facebook app, which will be written as simple PHP files. MySQL is a very popular open source database management system for running the PHP scripts you’ll need to write. Don’t worry what PHP stands for, as its original name is no longer valid and it now stands for something that begins with PHP itself. Recursive acronyms are a common joke among programmers. Other than PHP: Hypertext Preprocessor some other common ones you may have seen before are GNU's Not Unix and PNG's Not GIF.

From the Application settings, choose Canvas and set HTML as the rendering method. You may have heard of FBML (Facebook Markup Language, as opposed to Hyper Text Markup Language), but as of June 2012, the Facebook developers stopped supporting FBML and all apps are written in HTML, JavaScript, and CSS.

Using any WYSIWYG (What You See Is What You Get – essentially any text editor without automatic formatting [like Microsoft Word] such as Notepad) HTML editor, write the content that you want to display inside your Facebook application.

What is a canvas page? Simply the main page of your application that the user sees each time they click on your app. Set up a new app, give it a name. Enter in the following details:

Canvas URL– the unique name for your app @http://apps.facebook.com/. You can flesh it out with icons, descriptions, etc too.

Canvas Callback URL – the full URL of the canvas page to be stored on your MySQL server. Log in to your web server where you’ll be hosting the Facebook App and create a sub-directory called “facebook”. So if your domain is example.com, the Facebook app can be accessed from example.com/facebook.

Now we need to create a setup page for users that wish to add your app. A beginner should be using the official PHP client. What we’ll be doing is showing a simple image.

Source: Life Wire