FAQ

From Facebook Developers Wiki

Jump to: navigation, search

Bold textSee also: Gotchas, bugs & omissions, and Common error messages

Contents

[edit] Getting Started

[edit] This is very overwhelming! Where do I get started?

[edit] 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.

[edit] Where can I find a Web host?

[edit] Getting Applications Working

[edit] 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 authentication documentation 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.

[edit] 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?

[edit] 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:

<a href="http://www.facebook.com/install.php?api_key=0bd95845d4d3d59d4a3ac5dada401348" target="_top">

[edit] How can I tell if a user has added my application?

Use the fb:if-user-has-added-app FBML tag, like so:

<fb:if-user-has-added-app> Welcome to my app. This is my canvas page. I have options here. And it does stuff. La la la. <fb:else> <fb:error> <fb:message>Hey!</fb:message> <a href="<?= $facebook->get_add_url() ?>"><u>You need to install the application first!</u></a> </fb:error> </fb:else> </fb:if-user-has-added-app>

[edit] How do I update user's profile automatically?

  • View the multiple discussions on the developer board: 123456

[edit] How do I try out complex FBML without repeatedly calling "setFBML"?

Check out the test console: http://developers.facebook.com/tools.php?fbml

[edit] Application Configuration

[edit] 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.

[edit] Styling your Application

[edit] What are the widths of the canvas and the profile application box, and is there a limit to height?

  • The canvas is 646 pixels wide.
  • 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.
  • There is no known pixel height limit for Facebook profile box contents. (Verified up to 100,000px on May 06, 2008)

[edit] What are the colors Facebook uses?

Hex Usage
#0e1f5b
#3b5998 Header, Links
#7f93bc Line between "Facebook" and "Search"
#95a5c6
#bdc7d8
#c3cddf
#d8dfea
#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

[edit] How do I make my buttons look like Facebook buttons?

.button {border-color: #3b5998; background-color: #3b5998; color: white;}

OR

you can even just 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" />

[edit] Application Metrics

[edit] 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.

  1. 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%.
  2. 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%.
  3. 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 .