FAQ
From Facebook Developer Wiki
See also: Gotchas, bugs & omissions, and Common error messages
Getting Started
This is very overwhelming! Where do I get started?
- Try reading the official application creation guide.
- Check out Unofficial programming tutorials written by application developers.
- Check out Setting Up Your First Facebook Application written by Gavin Vincent. Gavin has included ColdFusion documentation and complimentary videos that are helpful to any language.
- Read Writing an ASP.NET Facebook Application for the basics of Facebook + ASP.NET.
How do I find someone to help me?
- If you're looking for someone who's working in a certain language, try posting something on the relevant language page of this wiki.
- For immediate interactive online help, many Facebook engineers are online in the IRC channel.
- The Facebook Developer Forum is another good resource if you are having trouble.
Where can I find a Web host?
- For a full year, you can use Joyent's Facebook Accelerator. for free Web hosting for your Facebook applications.
- Also, check out these relevant conversations on the message board: Finding a free PHP host, Finding a host to handle lots of traffic, Poll of hosts developers use.
Getting Applications Working
How do I create a desktop application using the Facebook Platform?
- Developers intent on creating a desktop application face unique challenges and constraints. In order to help understand and overcome these challenges consult the Desktop Application guide.
I'm getting an "Invalid Signature" exception thrown when creating a Facebook object
- Make sure you are passing all the components of your signature correctly. Double-check that the API_KEY and SECRET are correctly configured, and that you are MD5 hashing correctly. See the Authorizing Applications for more details.
- If you're not using our PHP client, make sure you are properly URL encoding all the data being posted, as you would with any other form.
My canvas page shows up blank. How do I debug it?
- If you're using FBML, click "view source" on the canvas page. If you're logged in as the person who developed the application, it shows you in an HTML comment the FBML that we retrieved from your server.
- If you have configured your canvas to use FBML, then make sure that you are accessing an externally available server. Facebook's servers cannot access "localhost" or an internal IP address.
- If you do want to develop using localhost, you can do so by configuring to use an iframe.
- Replace the canvas URL with your callback URL and try it in a browser to debug. For instance, if your canvas URL is apps.f8.facebook.com/your_application, and your callback URL is www.myapp.com, then when you go to apps.f8.facebook.com/your_application/foo/bar, then it will attempt to load www.myapp.com/foo/bar. Type in the second URL to debug.
- Does your callback URL send "Content-type: text/html\r"? Are you sure?
- Only a UTF-8 result will be parsed.
Comment:Basically, developers can't replace the canvas URL with their callback URL because upon editing the applications' settings, the http://apps.facebook.com is the default beginning of the canvas URL.
Links on my canvas page cause the Facebook frame to show up within the iframe
This is a problem that only happens with iframe configured. If you use FBML, you won't see this behavior. Any links within your iframe should make sure to include target="_top" to make sure they appear outside the iframe.
For instance:
This will cause a popup window in IE 7 with nested frames across domains.
How can I tell if a user has authorized my application?
Check for the fb_sig_added parameter we pass once a user authorizes your application.
Or, you can use the fb:if-is-app-user FBML tag, like so:
How do I update user's profile automatically?
- Prompt the user for the
offline_accessextended permission and store the session_key you get in your database or somewhere ($session_key = $_POST["fb_sig_session_key"]). Later you can do stuff on that user's behalf even if he's offline. For that you apparently need to set $facebook->set_user($user_id, $session_key);
How do I try out complex FBML without repeatedly calling "setFBML"?
Check out the test console: http://developers.facebook.com/tools.php?fbml
Application Configuration
Do I need to configure both the callback URL and the post-add URL with Facebook Platform?
- Yes. The callback URL is used to front any of your canvas pages, and is usually more or less the "root" of your application. The post-add URL is called after a user installs your application. It can refer to a canvas page if you like, which will get redirected into your application via the callback URL. See Your Callback Page And You for more details on the callback URL.
Styling your Application
How to Style an Application Like Facebook
Please read the following article, which extensively discusses how to style your application to fit in with the Facebook platform.
What are the widths of the canvas and the profile application box, and is there a limit to height?
- The canvas is 760 pixels wide (646 pixels wide on the old profile). You need to edit your application's settings in order for your canvas page to expand to the full 760 pixels - a nice consideration for backwards compatibility.
- The narrow profile box is 190 pixels wide, not including margins. The left margin is 10 pixels, but there is no right margin. For balanced margins, make your content 180 pixels wide.
- The wide profile box is 388 pixels wide, not including margins. The left margin is 8 pixels, but there is no right margin. For balanced margins, make your content 380 pixels wide.
- Narrow profile boxes on the main profile (the Wall and Info tabs) can be up to 250 pixels in height. There is no known pixel height limit for Facebook profile box contents on the Boxes tab. (Verified up to 100,000px on May 06, 2008)
What are the colors Facebook uses?
| Hex | Usage |
| #0e1f5b | |
| #3b5998 | Header, Links |
| #7f93bc | Line between "Facebook" and "Search" |
| #95a5c6 | |
| #bdc7d8 | |
| #c3cddf | |
| #d8dfea | |
| #eceff5 | Comments and likes background |
| #cccccc | Misc. borders/lines around facebook |
| #f7f7f7 | Background of left nav, inactive tabs, canvas backgrounds on eg. Photos app |
| #dd3c10 | Error box border |
| #ffebe8 | Error box background |
| #e2c822 | Attention box border |
| #fff9d7 | Attention box background |
How do I make my buttons look like Facebook buttons?
Set the class name of an input button to that of a facebook style. ie.
<input type="button" value="Make me look like Facebook!!!!" class="inputsubmit" />
Application Metrics
How can my user response metrics display a number greater than 100%?
On the Insights (statistics) page for your applications is a User Response Metrics tab, which contains a Metric Ratio column that lists the ratio of requests ignored vs. requests sent. The statistics for your application's requests are aggregated daily for the past 7 days of data. There are three possibilities as to why you are seeing such a number.
- If a number of requests from previous weeks were not acted upon until a particular day after the requests were sent, then you could have a number of ignored requests that exceeds the number of requests sent, resulting in a number greater than 100%.
- If Facebook disabled your application's ability to send requests or other notifications, and some number of requests sent out during previous weeks were ignored after your requests were disabled, then you would have a number of ignored requests that exceeds the number of requests sent, resulting in a number greater than 100%.
- Users could be choosing to ignore all requests. This feature was rolled out recently, so many users are ignoring a lot of built up requests from a long period. This should even out over time .
