Facebook.showPermissionDialog
From Facebook Developer Wiki
Contents |
Description
Method for FBJS and FBML applications to prompt the current session user to grant your application one or more extended permissions.
Parameters
| Required | Name | Type | Description | |
| required | permission | string | One or more extended permissions to request. Pass the permissions as a string of comma-separated values. Please see Extended permissions for a complete list. | |
|---|---|---|---|---|
| optional | callback | string | Callback function to be invoked after user has closed the permissions window. The callback takes one string parameter. On success, the dialog passes to the callback a string with a comma separated list of the permissions the user granted. On failure, or if the user canceled the permissions dialog, an empty string gets passed to the callback. | |
| enableProfileSelector | bool | If one of the permissions you are requesting is publish_stream, and the current user is a Page admin, setting enableProfileSelector to 'true' causes a dropdown list to appear in the permission dialog. This allows the user to select for which Page(s) the permission should be granted. The dropdown contains only Pages for which the publish_stream permission hasn't been granted. If the user isn't the admin of any Pages, the dropdown list doesn't appear. After the user grants the permission, you can use the page admin (FQL) and the permissions (FQL) tables to query which Pages the user admininsters have the publish_stream permission. (Default value is false.) | ||
| profileSelectorIds | array | An array of Page and/or user IDs used to filter the IDs shown in the dropdown described in the showProfileSelector parameter. Use it when you wish to request the publish_stream permission for a specific Page or set of Pages. (Default value is null.) |
Example Requests
Facebook.showPermissionDialog('publish_stream,read_stream', ondone, showProfileSelector, [1234,2345]);
Notes
- When specifying multiple extended permissions do not put spaces after the commas. The API does not seem to trim spaces after it splits the string into an array, so having spaces will cause those permissions to be ignored.
