Minggu, 04 Maret 2012

Dialogs Overview


Dialogs Overview

Dialogs provide a simple, consistent interface to display dialogs to users. Dialogs do not require special user permissions because they require user interaction. Dialogs can be used in any type of application, whether on Facebook.com, a website, or a mobile application.
You can integrate Dialogs into Your application by constructing the URLs documented below, or by using a helper method in one of the Facebook Platform SDKs:

Dialog URLs
Every dialog has a method name and parameters. The URL to a dialog always starts with
followed by the name of the dialog and parameters. For example, to ask a user to post a story to their Wall, send them to the Feed Dialog with required parameters:
Click here to try the above URL Yourself. The user will see a dialog that looks like below (though the one below has extra parameters). If the user is not already logged into Facebook, they will be asked to log in before being shown the dialog.
Feed dialog

Common Parameters
All Platform Dialogs share a few common parameters:
Name Is Required Description
app_id Yes Your application identifier.
redirect_uri Yes The URL to redirect to after the user clicks a button on the Dialog.
display No. Default is page Display mode in which to render the Dialog. Can be page, popup, iframe, touch, or wap. If You specify iframe, You must have a valid access_token. To get a valid access_token, please see the Authentication guide
show_error No If this is set to true, the error code and error description will be displayed in the event of an error.

Display Modes
Platform Dialogs are all built to seamlessly run in a variety of display contexts on both the web and mobile.
  • page: By default, dialogs run in full-page mode with a Facebook header and footer. This is appropriate for apps that do a full-page redirect in a normal desktop/laptop web browser.
  • popup: For use in a browser popup no bigger than 400px by 580px. Use this display type to maintain context for the user while on an external website.
  • iframe: Display the dialog in a lightbox iframe on the current page. Because of the risk of clickjacking, this is only allowed for some certain dialogs, and requires You to pass a valid access_token.
On Facebook canvas pages, Dialogs are supported only for iframe applications. For FBML applications, You can use some of the dialogs through specific FBJS methods.

Mobile Display Modes

To show a dialog to a user on a mobile device, change the subdomain of the dialog URL from www to m. Facebook will default to an appropriate view based on the user agent. To override that choice, You can explicitly specify one of two mobile display modes:
  • touch: Used on smartphone mobile devices, like iPhone and Android. Use this for tablets with small screens (i.e., under 7 inches) as well.
  • wap: Display plain HTML (without JavaScript) on a small screen, such as a Nokia 7500.
E.g., the URL for a Feed dialog displayed on a touch device:
With more parameters, this looks like:
Feed dialog on iphone


The Add Page Tab Dialog prompts the user to add an app to a Facebook Page that the user admins. This does not require any extended permissions.
Prompt the user to publish an individual story to a profile's feed
Prompt the user to add a friend.
Prompt the user to authorize and grant Your app permissions
Prompt a payment
Requests Dialog
Prompt the user to send a message to a friend, group or email address

0 komentar:

Posting Komentar