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.
I'm testing the website at localhost and I've created app in developers.facebook.com
Maybe the problem is that the app is in developing mode and that's why it's not giving me the full data?
Here is my code of taking the user data:
<?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 =& get_instance();
$ci->config->load('facebook', TRUE);
$config = $ci->config->item('facebook');
parent::__construct($config);
$this->user_id = $this->getUser();
$me = null;
if($this->user_id) {
try{
$me = $this->api('/me');
$this->user = $me;
} catch(FacebookApiException $e) {
error_log($e);
}
}
}
}