JS API M FB.Connect.showPermissionDialog
From Facebook Developer Wiki
(Redirected from JS API M FB.Connect.ShowPermissionDialog)
Contents |
public static void showPermissionDialog (string permission, string callback, bool showProfileSelector, array profileSelectorIds)
Description
Method for prompting the user to grant the application one or more extended permissions.
Parameters
| Required | Name | Type | Description | |
| required | permission | string | The extended permission(s) 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 callback returns a string with a comma separated list of the permissions the user granted. On failure, or if the user canceled the permissions dialog, null gets returned. | |
| 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
FB.Connect.showPermissionDialog("email", function(x){alert(x);}, true, [1234,2345]);
Notes
- If the user cancels the dialog, an empty string is returned, instead of null that's mentioned above.
- callback seems to get a string of permissions only granted via this particular instance of a dialog box. That is, if you are asking for multiple permissions, and the user has granted one of them previously, they will not be prompted about the permissions, and it will not be passed to the callback. If the user has already granted all of the asked-for permissions, the dialog will close itself and the callback will receive an empty string.
Back to class public FB.Connect
