$config['appId'] = 'your_app_id';After which, go to /application/config/autoload.php and add 'facebook' to the libraries array and it will automatically load those parameters into your library.
$config['secret'] = 'your_app_secret';
$config['cookie'] = true;
Afterwards your calling of the functions should look like this in the __construct() function:
function __construct()Hope this helps you with what you were looking for! Stay tuned for more as I discover more interesting things about the facebook sdk and codeigniter. Next time I will include a tutorial on how to make sure that your users get authenticated correctly via the system.
{
parent::__construct();
$this->fb_session = $this->facebook->getSession();
$this->fb_me = null;
// Session based API call.
if ($this->fb_session) {
try {
$this->fb_uid = $this->facebook->getUser();
$this->fb_me = $this->facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
}
}
$this->fb_appid = $this->facebook->getAppId();
$this->data['appid'] = $this->fb_appid;
$this->data['me'] = $this->fb_me;
$this->data['uid'] = $this->fb_uid;
}
No comments:
Post a Comment