title: How can I retrieve email via Facebook Graph API v2.8?
body: <p>I was using v2.2 for a long time, all worked well. 
  However I need to upgrade to v2.8 for some reason and the retrieval of email is not working anymore. 
  Can anybody tell me how the code should look like?</p>
  
  <p>Working v2.2 code that retrieved the email address:</p>
  
  <pre><code>FB.api('/me', function(response) {
    var fn = ('first_name' in response) ? response.first_name : "null";
    var ln = ('last_name' in response) ? response.last_name : "null";
    var fid = ('id' in response) ? response.id : "null";
    var mail = ('email' in response) ? response.email : "null";
    ...
  });
  </code></pre>
  
  <p>Initialization is done via this:</p>
  
  <pre><code>FB.init({
    appId      : 'myid',
    cookie     : true,
    xfbml      : true,
    version    : 'v2.8'
  });
  </code></pre>
  
  <p>And the login (which is also done before the API call of course) looks like this:</p>
  
  <pre><code>FB.login(function(response) {
    if (response.authResponse) {
      processLogin(response);
    } else {
      // user clicked cancel
    }
  }, {scope: 'public_profile,email'});
  </code></pre>
  
  <p><strong>Solution</strong><br>
  Here is the working v2.8 solution by using "declarative fields" in the API call:</p>
  
  <pre><code>FB.api('/me', {fields: 'first_name,last_name,email,id'}, function(response) {
    var fn = ('first_name' in response) ? response.first_name : "null";
    var ln = ('last_name' in response) ? response.last_name : "null";
    var fid = ('id' in response) ? response.id : "null";
    var mail = ('email' in response) ? response.email : "null";
    ...
  });
  </code></pre>