tags:

views:

143

answers:

1

Hi,

I am developing a facebook application (FBML) and i want to ask for certain extended permissions for the first time a user comes to app. How to do that?

Note that I am not using new graph API for this app.

+2  A: 

There are two ways I can think of:

  1. You use the fb:prompt-permission tag to render a link which when clicked pops up the extended permissions dialog.

  2. You redirect non-auth'd users to the app login page, requesting the appropriate permissions:

<fb:if-is-app-user>
<!-- your normal code -->
<fb:else>
  <fb:redirect url="http://www.facebook.com/login.php?v=1.0&amp;api_key=[your_app_key]&amp;next=[your_canvas_page_URL]&amp;canvas=&amp;req_perms=[comma-delimited list of permissions]"/>
</fb:else>
</fb:if-is-app-user>

Example redirect URL: http://www.facebook.com/login.php?v=1.0&amp;api_key=147433427237&amp;next=http%3A%2F%2Fapps.facebook.com%2Fkickabout%2F&amp;canvas=&amp;req_perms=publish_stream

See: http://wiki.developers.facebook.com/index.php/Authorization_and_Authentication_for_Canvas_Page_Applications_on_Facebook#Using_FBML

Cyphus

related questions