Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook app without asking permission on load

Tags:

facebook

How do I make an app that doesn't ask for permission when you load it?

Or is that impossible? The only thing the application does is post to the user's wall, but can't I authenticate for that after they load the application?

like image 754
jpoz Avatar asked Nov 05 '22 12:11

jpoz


2 Answers

You can, not sure why others are so positive that it is not possible.

On your server side you can check through facebook api if current user granted you required permission. If not, pass some flag to your fbml where you can display permission prompt link:

Would you like to <fb:prompt-permission perms="publish_stream">allow us</fb:prompt-permission> to post on your wall?

You are not obligated to require users to authorize your app either (but you need authorization before checking for granted permissions or retreiving any user information), you can still allow users to use your app. In fact allowing users to use an app without authorization is even encouraged by facebook recommendations. For optional authorization you can put such fbml on your page:

<fb:if-is-app-user> 
    <fb:else><a href="http://www.facebook.com/login.php?api_key=...&v=1.0>Would you like to authorize this app?</fb:else> 
</fb:if-is-app-user>
like image 144
serg Avatar answered Nov 09 '22 23:11

serg


If you want to post to their wall via a prompt instead of requiring prior authorization, you should use the connect library. Then you can use some javascript to open the dialog.

In fact, another SO question gives you exactly what you need.

like image 42
Tesserex Avatar answered Nov 10 '22 01:11

Tesserex