Prompt for extended permission in facebook app
Posted by mahmud ahsan on October 8, 2009 in
Facebook | 14 Comments
If you are working in facebook application, you may need to ask your user for extended permission. If you want to know more about extended permission please visit here and learn about extended permission.
In short, if your application want to access some special info of user or want to do some special tasks then it need the permission of the user. Now I’m describing how will you prompt for extended permission.
There is an FBML tag for this purpose
<fb:prompt-permission perms="read_stream,publish_stream">Would you like our application to read from and post to your News Feed?</fb:prompt-permission>
This code will render a link, when user will click that link, a permission box will open and ask user to give extended permission. But if that user already given that permission, then the box will open and close.
The special permission box looks like this:
Now If you want, the extended permission box should open after a javascript event occurs then what will you do?
The answer is its also possible as facebook provided a function for it.
Facebook.showPermissionDialog('publish_stream, read_stream', ondone, showProfileSelector, '');
So for fbml reference visit: http://wiki.developers.facebook.com/index.php/Fb:prompt-permission
for fbjs reference visit: http://wiki.developers.facebook.com/index.php/Facebook.showPermissionDialog
Related Posts
If you think this article kicked ass, subscribe to the RSS feed or follow me on Twitter! Share with your friends, or leave a comment below (or better still, do both!)Comments (14)



Hi There,
Can you give any idea how I can publish feed from external website ? I can publish but I want to put it on schedule.
What would be best possibly way to do this ?
How can I publish without prompting the user for permission ?
@Arif, if user provide you the extended permission publish_stream, then you can easily publish something on user’s wall. Please check http://wiki.developers.facebook.com/index.php/Facebook.showPermissionDialog for how to prompt user for extended permission. When you’ll get extended permission, then using cron and api you can publish scheduled message on users profile. check this link also: http://wiki.developers.facebook.com/index.php/Stream.publish
Thanks for your reply,Mahmud.
Well, the exact situation is I wanna post to my Page’s [as the Page itself] feed periodically from my website.
I can post to my Page[as page itself].But I get the Prompt dialog all the time even though I have granted the stream_publish and set the auto publish to true.
Can you please put me in light providing some code examples ?
However,You can check the code I am working on at :
http://ourgroup.isgreat.org/fbTest/testConnect.html
Hi Arif,
I am trying to do the same as you are with the Fan Page… did you find a solution for this?
Thanks,
Travis.
Try the php Client instead. FBJS doesn’t work for it.
Unfortunately we’ve tried that too… we are using the PHP4 client.
Any other suggestions?
Thanks
Travis.
Think seriously about finding a better way to do this. poor implementation will annoy users and breaks facebook development rules.
Thanks, simple solution is the best solution
I have created one Facebook application and its running perfectly. After enabling New Data Permissions for my app, when i add my app , it asks me to Accept or Reject. When I reject it I get Error 100. Can you help me out
But this is not happening for my application. So its tough to guess the reason.
thank s again!!!
Hi, im using your facebook photo-gallery app. I want to get different extended permisions when you first open the app.
Im trying with this: $user_id = $facebook->require_login($required_permissions = ‘email, publish_stream, status_update, user_birthday, user_location, user_work_history, user_photos, user_photo_video_tags’);
It works, but it only ask permission for “accesing to my basic info”, do you know why it ain’t asking for the other permissions?
My app is developed base on old facebook library. Update new facebook php library and place all the permissions name in the authentication place, then you’ll see all the permissions at one place. Checkout facebook’s latest library and their usage.
Hi
can anyone tell me how to get extended permission with require_login($required_permissions = ‘publish_stream’);
coz it only asks for basic info and not asks for extended permissions so what modifications i hav to made to get this code work.