Add Page Tab Dialog

With the Add Page Tab Dialog you can add an app to a Facebook Page that you administer. This does not require any extended permissions.

API

This dialog can be used with the JavaScript SDK, and by performing a full page redirect to a URL.

JavaScript SDK

FB.ui({
  method: 'pagetab',
  redirect_uri: 'YOUR_URL'
}, function(response){});

The above example assumes that the person has already logged in to your app.

URL Redirect

https://www.facebook.com/dialog/pagetab?
  app_id=YOUR_APP_ID
  &redirect_uri=YOUR_URL

Parameters

ParameterDescription

app_id

Your app's unique identifier. Required.

redirect_uri

The URL to redirect to after a person clicks a button on the dialog. Required when using URL redirection. This URL must be owned by the same app specified by the app_id. The redirect will include a URL parameter tabs_added which is an array of IDs of any pages that the app was added to using the dialog.

display

Determines how the dialog is rendered.

  • If you are using the URL redirect dialog implementation, then this will be a full page display, shown within Facebook.com. This display type is called page.
  • If you are using the JavaScript SDK, this will default to a modal iframe type for people logged into your app or async when using within a game on Facebook.com, and a popup window for everyone else. You can also force the popup or page types when using the JavaScript SDK, if necessary.
  • This dialog is not available on mobile devices.

Response Data

There is no response data for from this dialog, however the developer of the Page Tab app will be notified via a callback URL that someone has added their app to a Facebook Page.