I'll go ahead and feel silly in front of everyone, cuz I can't spot what the issue here is, though I suspect it will be a real groaner. maybe describing it will jog something in my mind.
i am doing a Facebook Connect integration with CI2.0, based on this guy's work:
which I've upgraded to 2.0
some relevant code bits are:
config/facebook.php:
$config['facebook_api_key'] = 'xxx'; (it is the ID, not the key, as he misnamed his array key)
$config['facebook_secret_key'] = 'xxx';
controllers/fb_login.php
function index() {
$this->load->library('fb_connect');
libraries/fb_connect.php
include(APPPATH.'libraries/facebook/facebook.php');
class fb_connect {
....
function fb_connect()
{
//Using the CodeIgniter object, rather than creating a copy of it
$this->_obj =& get_instance();
//loading the config paramters for facebook (where we stored our Facebook API and SECRET keys
$this->_obj->load->config('facebook');
//make sure the session library is initiated. may have already done this in another method.
$this->_obj->load->library('session');
$this->_api_key = $this->_obj->config->item('facebook_api_key');
$this->_secret_key = $this->_obj->config->item('facebook_secret_key');
$this->appkey = $this->_api_key;
//connect to facebook
$this->fb = new Facebook(array(
'appId' => $this->_api_key,
'secret' => $this->_secret_key,
'cookie' => true
));
and finally, the facebook php library: libraries/facebook/facebook.php
public function __construct($fb_config) {
print_r($fb_config);
$this->setAppId($fb_config['appId']);
$this->setApiSecret($fb_config['secret']);
if (isset($fb_config['cookie'])) {
$this->setCookieSupport($fb_config['cookie']);
}
The best way I can describe the issue is just to give you the output of print_r($fb_config):
Array ( [facebook_api_key] => xxx [facebook_secret_key] => xxx)
and Message: Undefined index: appId Message: Undefined index: secret
The facebook __construct() has been loading with the config file's $config[] array; no idea why it is doing this.
Thanks in advance for any leads or spottings of "dumb things I've done"