遇到错误无法加载请求的类:Facebook - Hav在应用程序/库中包含了facebook SDK

时间:2015-05-27 11:35:33

标签: php facebook codeigniter login oauth

public function login(){

$this->load->library('facebook'); // Automatically picks appId and secret from config

$user = $this->facebook->getUser();
if ($user) {
            try {
                $data['user_profile'] = $this->facebook->api('/me');
            } catch (FacebookApiException $e) {
                $user = null;
            }

1 个答案:

答案 0 :(得分:0)

你必须初始化配置..试试这个,

$fb_config = array(
   'appId'  => 'YOUR APPID',
   'secret' => 'SECRET KEY'
    );
$this->load->library('facebook', $fb_config);