views:

1247

answers:

2

I am having trouble of understanding how the fb:prompt-permission work. I can have a link appear when the user click the fb:login-button either the user already logged in from facebook to our application or through our website. On the other hand, without clicking the login-button, the link or the permission dialog doesn't render if the user already logged in from facebook to our page.

Doesn't that mean prompt-permission only available when the user clicks the login button ... Is there a way to avoid that?

+2  A: 

Use the standard FB Connect loginbutton, add on onlogin() function call

<fb:login-button onlogin="OnRequestPermission();"></fb:login-button>

and use this function to manually invoke the permission request dialog :

function OnRequestPermission(){
    var myPermissions = "publish_stream"; // permissions your app needs

  FB.Connect.showPermissionDialog(myPermissions , function(perms) {
    if (!perms)
    {
        // handles if the user rejects the request for permissions. 
        // This is a good place to log off from Facebook connect
    }
    else
    {
        // finish up here if the user has accepted permission request
    }
  });
}

Source: http://forum.developers.facebook.com/viewtopic.php?pid=190797

svallory
A: 

Use this:

<fb:login-button perms="publish_stream, email">Login and Install</fb:login-button>

Source: http://developers.facebook.com/docs/guides/web

Manuela M.