Facebook Extended Permissions are used to allow the user to add extended permissions, like sending upload images and status updates, to Facebook application. It is important to know correct usage of this control, in comparison with Facebook Login Button, which can also be used to set permissions. For permissions which are required for basic capabilities of your Facebook application or website, it is recommended to use Login Button, so that user can give the permissions on the first time he uses the application or the website. Permissions control is used to add extra permissions which are not crucial, but offer extra functionality which user can allow later. Example of using Permissions control is adding permission to send SMS or/and email to user. It is also possible to define JavaScript code which will be executed, and form id which will be submitted, after permissions are confirmed by user.
Extended Permissions Popup Image
Following image shows Extended Permissions popup shown in Mozilla Firefox. In this example, permission to send SMS messages and emails is requested.
PHP Example
The example shows adding SMS and email Facebook extended permissions using Permissions control in PHP code. After permissions are approved, it is configured that form 'form1' is submitted. This results in transfer to 'EmailSms.php' page, where extra code can be executed (for example, sending welcome messages).
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> <head> <title>Facebook Extended Permissions</title> </head> <body> <?php require_once 'facebook.php'; require_once 'faceconn/faceconn.php'; UseGraphAPI(); ?> <form id="form1" action="EmailSms.php"> <?php $perms = new Permissions(); $perms->SetPermissions("email, sms"); $perms->SetOnConfirmSubmitForm("form1"); $perms->Render(); ?> </form> </body> </html>
Configuration
Configuration of the Facebook Extended Permissions PHP class is done through calls of the setter methods, which in turn set the private properties. For Facebook Extended Permissions PHP class, there is only one property which is required to be set, while all others are optional. After the configuration is set, all you have to do is to call Render() method, and the permissions control will display on the page.
Setting mandatory properties
Setting optional properties

