2012-08-05 90 views
1

正在開發使用codeigniter框架的Facebook應用程序,我正在使用php-sdk函數連接到facebook庫,並且正在使用以下代碼指導用戶登錄框,如果用戶未登錄Facebook的從我的Facebook應用程序登錄到Facebook

$params = array(
     'scope' => 'read_stream, friends_likes' 
     'cancel_url' => 'http://www.facebook.com/', 
     'canvas' => 1, 
     'fbconnect' => 0, 
     'req_perms' => 'publish_stream, read_stream, read_friendlists,email', 
     'redirect_uri' => 'http://apps.facebook.com/morganmarket', 
     'next' => 'http://apps.facebook.com/morganmarket', 
     'display' => 'popup' 
    ); 
    $loginUrl = $this->facebook->getLoginUrl($params); 
    echo '<script> window.top.location="' . $loginUrl . '"</script>'; 

的問題,當我嘗試使用我的被記錄在Facebook上進行應用,它引導我到一個頁面錯誤

The page you requested was not found. 
You may have clicked an expired link or mistyped the address. Some web addresses are case sensitive. 

Return home 
Go back to the previous page 

是什麼讓這accordign的問題我的代碼,它應該引導我到Facebook登錄佛然後到我的應用程序。

+0

不知道,但聽起來像Facebook的一側的錯誤... – 2012-08-15 13:05:31

回答

0

在我笨應用evrything是好的:)

恆星

$config['facebook_login_parameters'] = array(
             'scope' => 'user_likes, friends_likes, email', 
             'display' => 'page', 

             'cancel_url' => 'http://www.facebook.com/', 
             'redirect_uri' => 'http://apps.facebook.com/amnestyapp/', 
             'canvas' => 1, 
             'req_perms' => 'publish_stream, read_stream, read_friendlists,email', 
             'next' => 'http://apps.facebook.com/amnestyapp/', 

             ); 

卓柏卡布拉

class Chupacabra extends CI_Controller { 

function index() { 
    $this->load->model('fizzlebizzle'); 
    $result = $this->fizzlebizzle->get_user(); 


    if ($result['is_true']) { 
     $this->session->set_userdata(array('facebook_uid' => $result['facebook_uid'], 'is_logged_in' => TRUE)); 
     redirect('secure', 'refresh'); 

    } else { 
     //$data['page'] = 'home_view'; 
     //$this->load->view('template', $data); 
     // tu logowanie 


     $loginUrl = $this->facebook->getLoginURL($this->config->item('facebook_login_parameters')); 
     echo '<script> window.top.location="' . $loginUrl . '"</script>'; 

    } 
} 

function logout() { 
    $this->auth->logout(); 
} 

}

相關問題