Dialogs Overview
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:
- JavaScript SDK using the FB.ui method.
- iOS SDK using the dialog method.
- Android SDK using the dialog method.
Dialog URLs
Every dialog has a method name and parameters. The URL to a dialog always starts with
http://www.facebook.com/dialog/
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: http://www.facebook.com/dialog/feed?
app_id=123050457758183&
redirect_uri=http://www.example.com/response/
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.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 validaccess_token
.
Mobile Display Modes
To show a dialog to a user on a mobile device, change the subdomain of the dialog URL fromwww
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.
http://m.facebook.com/dialog/feed?
app_id=123050457758183&
redirect_uri=http://www.example.com/response/&
display=touch
With more parameters, this looks like:Dialogs
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 a payment
Requests Dialog
Prompt the user to send a message to a friend, group or email address
0 komentar:
Posting Komentar