title: Facebook Login/Registration with Codeigniter - user data
body: <p>I have a problem with the user data - the only data that I recieve after Facebook Login is 'name' and 'id', which is the facebook id of the user. I also need to recieve 'firstname', 'lastname' and 'email. </p>
  
  <p>I'm testing the website at localhost and I've created app in developers.facebook.com</p>
  
  <p>Maybe the problem is that the app is in developing mode and that's why it's not giving me the full data?</p>
  
  <p>Here is my code of taking the user data:</p>
  
  <pre><code>&lt;?php
  include(APPPATH.'libraries/facebook/facebook.php');
  
  class Fbconnect extends Facebook {
  
      public $user = null;
      public $user_id = null;
      public $fb = false;
      public $fbSession = false;
      public $appKey = 0;
  
      public function Fbconnect() {
  
          $ci =&amp; get_instance();
          $ci-&gt;config-&gt;load('facebook', TRUE);
          $config = $ci-&gt;config-&gt;item('facebook');
  
          parent::__construct($config);
  
          $this-&gt;user_id = $this-&gt;getUser();
          $me = null;
          if($this-&gt;user_id) {
              try{
                  $me = $this-&gt;api('/me');
                  $this-&gt;user = $me;
              } catch(FacebookApiException $e) {
                  error_log($e);
              }
          }
      }
  } 
  </code></pre>