Anatomy of a Facebook App
From Facebook Developer Wiki
Contents |
Anatomy of a Facebook Application
A Facebook application can take on many forms. However, to fully utilize the suite of integration points and deliver a full user experience, we recommend integrating your application into the following areas of the Facebook profile:
- Application Directory
- About Page
- Canvas Page
- Profile
- Privacy Settings
- Feed
- Alerts
- Requests
- Interacting with Users
In the article, you'll see how our sample application Smiley integrates many of these various components. Note that none of these integration points are mandatory, but the more you include in your application the richer the user experience becomes. You can also see another detailed explanation of the various integration points.
You'll specify these integration points when you configure your application.
Application Directory
Many users may find your application by browsing the Facebook Application Directory. This is where beautiful imagery and concise, descriptive text pay off. You need to submit your application to Facebook so it can be included in the directory.
About Page
The About page tells users about the application and is accessed from the Facebook Application Directory. It should inspire users to interact with your application. The About page is a Facebook Page.
Canvas Page
This is the main page of your application on Facebook. Application canvas pages appear within the Facebook frame and can either be FBML or an external Web site presented within an iframe.
User Dashboard
The user dashboard is usually accessed at the top of the application's canvas page. This is where users manage their own content within an application or see information about another user's content within that application.
To create a dashboard, use the Fb:dashboard FBML tag.
Profile
The Facebook profile is the online representation of the user's real world identity. We have included many integration points on the profile. This enables you to empower users to express themselves through your application.
Note: Facebook is changing the layout of the user profile and home page. Read the Developer Roadmap for details.
Application Navigation
We're changing navigation to all applications. Read the Roadmap Home Page and Roadmap Dashboards for details.
Bookmarks
Bookmarks appear on every user's home page. Read how you can get your users to bookmark your applications.
Note: Your application icons appear on off-white backgrounds. We strongly recommend that, if you're not already doing so, you use transparent GIFs for your icons. For most applications, this should be as easy as adding transparency to the edges of the icon.
Application Tabs
Application tabs let users feature full canvas-like pages for applications they enjoy the most. Tabs behave like a hybrid of a canvas page and a profile box.
You can read more information about tabs and how they behave.
Publisher
Applications can integrate into the Publisher so users can create or find rich content and post it directly into their own or their friends' Walls. And these stories can leverage any of the new Feed story sizes — see below for more details.
Feed Forms
Feed forms are special FBML components that allow applications to publish Feed stories on the behalf of users. Your application can publish directly into the user's and the user's friends' Walls. You can read more about how we're updating publishing to Facebook.
Privacy Settings
Users can set their privacy options from your application's privacy/settings page. These options include approval for publishing stories...
... and whether the user wants to add or remove your application's profile box, tab, and info section, and who can see these elements.
A user can also decide whether to add a bookmark for your application. Bookmarks appear on the Applications menu — see above.
Feed
Applications can access a user's Feed and post content to it. For example, the Photos application publishes Feed stories about photos a user and her friends have uploaded recently. Each user has a maximum number of Feed stories that they can see from all applications. Once that maximum is reached they cannot see any more application stories during that sweep.
You send Feed stories as notifications; use Notifications.send.
In addition, your application can post content directly onto users' profiles by using Feed forms and the Publisher.
Alerts
Read Roadmap Notifications to see how your application can communicate with your users.
Requests
Applications can create requests that are usually initiated by a user's friend and often require the user to take some form of action. An example of this in the Photos application is a photo tag request confirmation.
We're transitioning requests to the Inbox and invites. Read Roadmap Requests for details.
Interacting with Users
While the current version of the API does not support performing Facebook-specific actions directly, you can direct your users to various Facebook pages to perform an action. To do this, link the user to one of the following pages:
| To... | Use this URL... |
| View the specified user's profile. | http://www.facebook.com/profile.php?id=UID or http://www.facebook.com/USERNAME |
| Poke the specified user. | http://www.facebook.com/poke.php?id=UID |
| Send a message to the specified user. | http://www.facebook.com/message.php?id=UID&subject=XXXXX&msg=XXXXX
Note: |
| Add the specified user as a friend. | http://www.facebook.com/addfriend.php?id=UID |
| See photos taken by the specified user. | http://www.facebook.com/photos.php?id=UID |
| See photos of the specified user. | http://www.facebook.com/photo_search.php?id=UID |
| Read or post on the specified user's Wall. | http://www.facebook.com/wall.php?id=UID |
| Read the specified user's notes. | http://www.facebook.com/notes.php?id=UID |
| Share an article using Facebook Share. | http://www.facebook.com/sharer.php?u=URL_TO_SHARE&t=TITLE_OF_PAGE |
Note: Facebook doesn't look fondly upon spammy behavior, so please don't encourage your users to abuse this functionality.
