After going through 2 series of tutorials, I believe there is not need to explain what are extended permissions.

 

Revision on How Extended Permissions are Requested in App using PHP SDK.

As a revision, to displayed (if required) the logon and request extended permissions pages for app built on top of the PHP SDK, the following code can be used:

if (!$fbme) {
 $loginUrl = $facebook->getLoginUrl(array('canvas' => 1,
                                          'fbconnect' => 0,
                                          'req_perms' => 'publish_stream',
                                          'next' => $canvas_base_url . 'my_friend.php',
                                          'cancel_url' => $canvas_base_url ));
 echo '<fb:redirect url="' . $loginUrl . '" />';
} else {

// $fbme is valid i.e. user can access our app
}

 

How to Request Extended Permissions for App using the new JavaScript SDK?

For our app built on top of the new PHP SDK, when we have checked that we don't have the permissions required, we will redirect the user to a login page (which URL is obtained by the "$facebook->getLoginUrl" method).

For a web site connect to Facebook via using the new JavaScript SDK, the situation is slightly different:

As a result of this, our "Publish Post onto my Wall" page will adopt the following processing when the page is loaded:

 

Publishing a Post using the new JavaScript SDK

When using the JavaScript SDK, we will call the FB.api method to publish the post via the Graph API.

My Comments on the Revised User Experience

Well, you may find it a little bit clumsy on the page flow and have the "Grant Permissions" button displayed. The demo app work in such a way now as I aim to show how a specific feature can be implemented.

Another way that I can think of to implement the "Publish Post onto My Wall" is to have the checking of extended permission done when the user click the menu item. Only when everything is fine, then the "Publish Post onto My Wall" will be loaded (or in fact we can simply display the confirmation message on the page or using popup. For this, I will leave it to you!

 

That's all for this series of tutorials on the new JavaScript SDK!

You can test drive the demo of Our 1st FB App (JS SDK) by visiting here.