views:

399

answers:

3

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?

A: 

Or is that impossible. The only thing the application is going to do is post to the users wall, but can't I authenticate them for that after they load the application?

To publish content to users' walls, you need to have the steam_publish permission from them first.

Sarfraz
+1  A: 

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.

Tesserex
+1  A: 

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=...&amp;v=1.0&gt;Would you like to authorize this app?</fb:else> 
</fb:if-is-app-user>
serg
This is the solution for fbml apps, mine applies for iframe apps. I've gotten so used to doing iframe all the time I forgot about fbml :p
Tesserex
If it is iframe then you have full access to facebook javascript api, so you can prompt for permission from javascript.
serg
At the time, I thought he wanted to write a malcious app. I didn't even think about this possibility. My bad. :oops:
Zack

related questions