title: Facebook login : Make email mandatory
body: <p>We are using facebook for login in our website.
  <br>We need email as a mandatory permission. If the user doesn't grant email permission then the dialog should give an alert() message saying 'Please grant email permission' and repeat.
  <br><br> I have seen this feature in few of the shopping sites. The below code works fine but doesn't have the feature I mentioned.
  <br>Help needed.</p>
  
  <pre><code>  window.fbAsyncInit = function () {
              FB.init({
                  appId: 'MY APP ID',
                  oauth: true,
                  status: false, // check login status
                  cookie: true, // enable cookies to allow the server to access the session
                  xfbml: true // parse XFBML
               });
      };
  
      function fb_login() {
          FB.login(function (response) {
              if (response.authResponse) {
                  access_token = response.authResponse.accessToken; //get access token
                  user_id = response.authResponse.userID; //get FB UID
  
                  FB.api('/me', function (response) {
                      // you can store this data into your database
                      alert(response.email);
                  });
  
              }
          }, {
              scope: 'email'
          });
      }
      (function () {
          var e = document.createElement('script');
          e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
          e.async = true;
          document.getElementById('fb-root').appendChild(e);
      } ());
  </code></pre>
  
  <p>Somewhere in the body of HTML.
  <div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="span"&gt;&lt;a onclick="fb_login();"&gt;&lt;img src="css/images/facebook.png" alt=""/&gt;&lt;sm&gt;Sign In with Facebook&lt;/sm&gt;&lt;div class="clear"&gt;&lt;/div&gt;&lt;/a&gt;&lt;/div&gt; </code></pre>
  </div>
  </div>
  </p>