2014-07-06 52 views
2

一切正常工作與測試用戶,但是當我發佈我的應用程序和用戶點擊應用程序權限彈出對話框不會出現。我想有一些oauth問題,但不確定。請幫助我Facebook應用程序不會彈出權限

require 'facebook-files/facebook.php'; 
$app_id='xxxxxxxxxx'; 
$secret='xxxxxxxxxxxxx'; 

$facebook = new Facebook(array(
    'appId' => $app_id, 
    'secret' => $secret, 
    'cookie'=> true, 
    'grant_type' => 'client_credentials' 
)); 

// Get User ID 
$user = $facebook->getUser(); 

if ($user) { 
    try { 
     //$access_token = $facebook->getAccessToken(); 

    // Proceed knowing you have a logged in user who's authenticated. 
     $user_profile = $facebook->api('/me'); 
     $friends = $facebook->api('/me/friends?fields=id,name,birthday,picture'); 
     $event = $facebook->api('/me/?fields=events.fields(id,name)'); 

    } catch (FacebookApiException $e) { 

    echo "Exception".error_log($e); 
    $user = null; 
    exit; 
    } 
} 
// Login or logout url will be needed depending on current user state. 
if ($user) { 
    $logoutUrl = $facebook->getLogoutUrl(); 
} else { 
    $loginUrl = $facebook->getLoginUrl(array(
    'scope' => 'read_stream,publish_actions,publish_stream,user_birthday,friends_birthday', 'display'=>'popup') 
); 
} 
+0

只要確保...但你的彈出式窗口攔截器是禁用的權利?如果您啓用了彈出式窗口攔截器,則會阻止權限窗口。 –

+0

我沒有任何彈出式窗口攔截器 – user3300206

回答

0

請確保將您的網站添加到應用設置中的「有效oauth重定向uris」輸入字段。