title: Facebook SDK for Javascript, FB.login() callback not firing (async call never gets a response?)
body: <p>The below code is my Facebook API <code>javascript</code> so far. It's pretty simple, with a bunch of <code>console.log()</code>s to follow the code flow. (I recognize that naming arguments response and response2 is terrible practice but it's just what I put quickly for now to avoid naming conflicts).</p>
  
  <p>As it stands, <code>FB.init()</code> succeeds, <code>FB.getLoginStatus()</code> works, and the two <code>FB.api()</code> calls work, but <code>FB.login()</code> never happens. It is async though so the <code>console.log()</code>s just before and just after do execute. To summarize, my console output is:</p>
  
  <blockquote>
    <p>makes it here<br>
    makes it here too<br>
    Permissions:
    Object {data: Array[37]} 
    Good to see you, my-name-is-here.</p>
  </blockquote>
  
  <p>I guess it's because the async <code>FB.login()</code> call never gets a response so the callback never fires, thus no <code>console.log()</code>s from inside the function. But I need this <code>FB.login()</code> in order to get extended permission <code>ads_management</code>. Any idea what is wrong, or at least a direction to go about solving this myself?</p>
  
  <pre><code>window.fbAsyncInit = function() {
  
    FB.init({
      appId: 'my-app-id-is-here',
      xfbml: true,
      version: 'v2.0'
    });
  
    FB.getLoginStatus(function(response) {
  
      if (response.status === 'connected') {
  
        FB.api('/me', function(response2) {
          console.log("Good to see you, " + response2.name + ".");
        });
  
        FB.api('/me/permissions', function(response2) {
          console.log("Permissions:");
          console.log(response2);
        });
  
        console.log("makes it here");
        FB.login(function(response2) {
          console.log("why not here?");
          if (response2.authResponse) {
            console.log("Response to login asking for ads_management permission");
            console.log(response2);
          } else {
            console.log("User cancelled login or did not fully authorize.");
          }
        }, {
          scope: 'ads_management',
          return_scopes: true
        });
        console.log("makes it here too");
  
      } else {
  
        // filled with other code that doesn't effect this question yet
  
      }
  
    });
  };
  </code></pre>
  
  <h3>UPDATE:</h3>
  
  <p>Taking away the parameters argument <code>{scope: 'ads_management', return_scopes: true}</code> makes the <code>FB.login()</code> call at least be attempted, but in the console there is now the error: </p>
  
  <blockquote>
    <p>"FB.login() called when user is already connected."</p>
  </blockquote>
  
  <p>but I thought the way to get more permissions when the user is already logged in IS by calling <code>FB.login()</code> again, with the desired permissions specified in the parameters argument.</p>