Home
Blog
Platform Dialogs, Reloaded

December 8, 2010

Platform Dialogs, Reloaded

By Brent Goldman

Today we are releasing improvements to our Platform Dialogs, which let users take actions, like publishing a stream story or sending a friend request, from your application. Dialogs allow developers to build seamless social experiences in their own applications while keeping users in control. Dialogs let users see what action is being taken, add additional messages, and adjust privacy settings, all without your application requesting extended permissions.

Our new Platform Dialogs are designed to work identically for developers building applications on Facebook.com, third party websites, and mobile devices (both handheld and tablets). You can use a consistent request in your application and we will render a dialog that is optimized for the device and context.

Starting today, you can use the new Feed Dialog to publish stories, the new Friend Dialog to add friends, and the OAuth Dialog to authorize users. You can expect other Dialogs in the future for important scenarios like sending application requests and inbox messages.

These dialogs can be invoked with a simple HTTP request or by using our existing SDKs (JavaScript, iOS, and Android).

<

p>Let’s take a look at an example using the JavaScript SDK:

&lt;html>
  &lt;body>
    &lt;script src="http://connect.facebook.net/en_US/all.js">&lt;/script>
    &lt;div id="fb-root">&lt;/div>
    &lt;script>
      // assume we are already logged in
      FB.init({appId: '123050457758183', xfbml: true, cookie: true});

      FB.ui({
          method: 'feed',
          name: 'Facebook Dialogs',
          link: 'http://developers.facebook.com/docs/reference/dialogs/',
          picture: 'http://fbrell.com/f8.jpg'
          });
     &lt;/script>
  &lt;/body>
&lt;/html>

This call loads the following URL in an iframe:

http://www.facebook.com/dialog/feed?
    app_id=123050457758183& 
    name=Facebook%20Dialogs&
    link=http://developers.facebook.com/docs/reference/dialogs/&
    picture=http://fbrell.com/f8.jpg&
    redirect_uri=http://www.example.com/response/

The user will see a dialog that looks like the following:

We encourage developers to move to these new dialogs by either downloading the latest version of our SDKs or replacing the URLs they are currently using. This will ensure that your application works well on all devices. Further, we will only be making improvements to these new dialogs going forward.

The full documentation and more examples are available in on our Platform Dialog reference page. If you have questions or other feedback, please let us know in the comments below.

Brent, an engineer on the Platform team, loves a good, clean abstraction.


TAGS

Get our newsletter

Sign up for monthly updates from Meta for Developers.

Sign up