News

Thursday, December 27, 2007 at 12:56pm

Published by Sasha Rush

The Facebook Platform team is always looking for ways to make your apps more responsive and simpler to manage. With these two goals in mind, we're happy to announce several new beta features.

1) Cookies and more. – Cookies are an integral feature of the web. They integrate into many popular frameworks and make it easy to manage user data, and now you can use cookies on Facebook canvas pages. An important difference is that these are associated with the app rather than with a particular domain. In addition, since they are stored on the Facebook server, you can query and set them even when the user is offline. Note that: Cookies without an ‘expires’ attribute will never expire. Since the cookies are stored with the user’s Facebook account, they get the benefit of having that state present across browsers and machines.

To supplement cookies, we also are introducing Preload FQL rules. These rules allow an app to specify parameterized FQL queries that are run when the user makes a request to the Facebook server. The results are then passed to your app server as post params.

2) Improved AJAX support - Many apps already use FBJS in innovative ways, and as part of this release we offer improved AJAX capabilities in FBJS. The new feature is a local proxy that allows you to make direct async requests back to your application server. This trick lets you to gain all the advantages of FBML without needing to use an embedded IFrame. To make this ability even more useful, we also now provide a DOM function setInnerXHTML that lets you to modify your canvas page by adding a string of HTML.

3) Cached Include files – To further speed up canvas pages, we now allow you to specify link tags on canvas pages that point to external CSS files, in addition to script src tags to point to FBJS files. This saves the processing time of sending these files through our sanitizer on each request and caches these files on the user's browser.

4) Admin API - Users with multiple apps often complain about having to go through the developer console to update application settings. We now offer an Admin API that lets you set and query settings for your apps. Going forward, this will allow us to associate more complex programmatic data with apps and support third-party app management tools.

To find out more about all these features, check out the Beta Features category on the wiki.

Happy Holidays!

Friday, December 14, 2007 at 3:26pm

Published by Justin Mitchell

We are changing the way profile.setFBML works to break out the profile box FBML, profile action FBML, and mobile FBML.

For those using the PHP client library, you'll want to make sure you have the latest version from http://developers.facebook.com/resources.php. The new method call is:

$facebook->api_client->profile_setFBML('', 12800193, 'profile FBML here', 'profile action fbml here', 'mobile fbml here');

The first parameter ($markup) will be deprecated, and any profile actions or mobile fbml contained therein will be ignored in the near future. We will still support setting mobile and profile action FBML in the markup parameter for the next two weeks. On 1/17/2007 we will remove this support and you will need to use the new parameters for setting profile action and mobile FBML. Of course, you may start using the new parameters sooner. Check out the wiki page for more details.

We are making these changes to more efficiently parse different forms of profile information. Currently, we take in markup that contains FBML for the profile box, mobile FBML, and the profile action together. Unfortunately, this means we have to parse all three FBML segments when we usually need only one or two. This change will allow us to parse the minimal amount of FBML necessary and therefore make profiles load faster.

Update: The change will now take effect on 1/17/2008.

Thursday, December 13, 2007 at 12:33am

Published by Ami Vora

At Facebook, we’ve always recognized that social context is an essential part of providing a great experience for our users, and we’ve wanted our users to have the best social experience whether they were on our site or off. That’s why, back in August 2006, we released the Facebook Platform API – with that release, developers could incorporate the data users chose to share into their own sites or applications to give users a more social experience no matter where they were. With the launch of the most recent version of Facebook Platform in May 2007, we also opened up the Facebook website itself.

We’ve seen a great response from both our developers and our users, and we’ve certainly learned a lot as we’ve worked on our platform over the past year and a half.

Now we also want to share the benefits of our work by enabling other social sites to use our platform architecture as a model. In fact, we’ll even license the Facebook Platform methods and tags to other platforms. Of course, Facebook Platform will continue to evolve, but by enabling other social sites to use what we’ve learned, everyone wins -- users get a better experience around the web, developers get access to new audiences, and social sites get more applications.

This is just another step toward the vision of easy, open sharing of information. We look forward to supporting other social sites as they release their own platforms, and look forward most of all to the added benefit for developers and users.

You can find more information and additional technical details at http://developers.facebook.com/specification.php.

Thanks for developing!

Thursday, December 6, 2007 at 1:29pm

Published by Wei Zhu

We added a new feature to enable referencing FBJS scripts using the “src” attribute of <script> tag on a Canvas page. This feature is useful for referencing large FBJS scripts that can be cached on user’s browsers.

 

In order to use this feature, you just need to use regular <script> syntax in HTML. Here is an example:

<script src=”http://foo.com/bar.js” ></script>

 

When this FBML is rendered into HTML, the src attribute will be changed to point to a Facebook url that contains a cached FBJS script of the original url. In addition, the browser caching of this url is set to never expire so that client browser will cache it as well.

 

Here is some general guideline when using this feature:

  1. The “src” attribute in FBML is only enabled for canvas page at this time.
  2. Please limit the total number of unique scripts for your app (across all canvas pages) to less than 1000. Facebook may start deleting old scripts if your app uses more than 1000 scripts.
  3. Please make sure that you don’t use a different script url per user. For example, http://foo.com/bar.js?user_id=11 and http://foo.com/bar.js?user_id=22 should never be used.
  4. Since the cache policy is set to never expire, you should update the url if and only if the content of the script changes. For example, you can change http://foo.com/bar.js?v=1.0 to http://foo.com/bar.js?v=2.0 or http://foo.com/v1.0/bar.js to http://foo.com/v2.0/bar.js when a new version of the script is available.
  5. To reduce the number of HTTP requests per page (at least for the first page load) and improve performance, we recommend that you limit your FBJS script references to no more than 10 per page.
  6. If your script code is small (say a few lines), it’s probably better to embed it inline instead of using “src”.

This feature is currently in Beta, and we’d love to get your feedback and suggestions to help us improve.

 

Happy coding!

Wednesday, December 5, 2007 at 2:43am

Published by Justin Mitchell

At Facebook, we're always striving to make a more open environment for developers while respecting our users' privacy. So far, we've enforced this by requiring users to sign up for Facebook before being able to interact with an application. Unfortunately, this means applications are inaccessible to the millions of people on the Internet that haven't joined Facebook yet. This policy also prevents applications from being indexed by search engines that might fuel their growth. Clearly, this is not ideal for developers.

As of tonight, 12/4/07, this will no longer be a problem. We will start allowing people to access application canvas pages even when not logged in to Facebook. Of course, we're concerned about our users' privacy, and so the only user-specific data available on public canvas pages will be first name and profile picture (and then only if the user's profile picture is already publicly searchable). But you, the application developer, need not worry; FBML tags will automatically handle privacy rules for you.

The technical details of making your pages publicly accessible are on the wiki at http://wiki.developers.facebook.com/index.php/Public_Canvas_Pages.