FB.login () does not request permission data

The input works, but it only asks for basic permissions and does not trigger a warning when the dialog is canceled or terminated.

 window.fbAsyncInit = function() {

    // init the FB JS SDK
    FB.init({
      appId      : 'XXX', // App ID from the App Dashboard
      channelUrl : 'XXX', // Channel File for x-domain communication
      cookie     : true, // set sessions cookies to allow your server to access the session?
      xfbml      : true,  // parse XFBML tags on this page?
      frictionlessRequests: true,
      oauth: true
    });

     FB.login(function(response) {
       if (response.authResponse) {
         alert("ok");
       } else {
        alert("canceled");
       }
     }, {scope:'publish_actions,publish_stream'});

  };
+5
source share
3 answers

Are you using fb: login-button? If so, have you tried adding permissions there, and not in FB.login ()? So it will look something like this:

<fb:login-button scope="publish_actions,publish_stream"></fb:login-button>
+9
source

Important: if your Facebook application is open, send the permission you would like to receive to Facebook if you haven’t. Check out the developer toolbar. If you are in development, do not make your application public and add users for testing through the Facebook toolbar.

+2

I don’t know if you will use OG actions, if not, you should read publish_actions / publish_stream about this: http://developers.facebook.com/blog/post/2012/04/25/streamlining-publish_stream-and-publish_actions -permissions /

For your alert problem, try removing oauth var.

0
source

All Articles