How to ask for permission in facebook application?
I am developing a facebook application (FBML) and i want to ask for certain extended permissi开发者_如何转开发ons 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.
There are two ways I can think of:
You use the fb:prompt-permission tag to render a link which when clicked pops up the extended permissions dialog.
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&api_key=[your_app_key]&next=[your_canvas_page_URL]&canvas=&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&api_key=147433427237&next=http%3A%2F%2Fapps.facebook.com%2Fkickabout%2F&canvas=&req_perms=publish_stream
See: https://developers.facebook.com/docs/authentication/
精彩评论