無法打開我的應用程序, 我是一個新手,以Facebook應用程序開發 我只是想獲取登錄用戶的用戶名,並顯示它 但我無法登錄,我總是得到錯誤信息Facebook的圖形API/PHP SDK登錄問題
這是簡單的代碼複製了developer.facebook.com
我也試過指定的權限和重定向URL,但還是沒有用 請大家幫幫忙它,我已經卡住過去兩天
here針對PHP頁面的代碼
<?
// Remember to copy files from the SDK's src/ directory to a
// directory in your application on the server, such as php-sdk/
require_once('src/facebook.php');
config = array(
'appId' => '***',
'secret' => '***',
);
$facebook = new Facebook($config);
$user_id = $facebook->getUser();
?>
<html>
<head></head>
<body>
<?
if($user_id) {
// We have a user ID, so probably a logged in user.
// If not, we'll get an exception, which we handle below.
try {
$user_profile = $facebook->api('/me','GET');
echo "Name: " . $user_profile['name'];
} catch(FacebookApiException $e) {
// If the user is logged out, you can have a
// user ID even though the access token is invalid.
// In this case, we'll get an exception, so we'll
// just ask the user to login again here.
$standalone_url = 'http://localhost/trial/';
$login_url = $facebook->getLoginUrl(array(
'next' => $standalone_url.'next.php',
'redirect_uri' => $standalone_url.'message.php',
'scope' => 'user_about_me'));
echo 'Please <a href="' . $login_url . '">login.</a>';
error_log($e->getType());
error_log($e->getMessage());
}
} else {
// No user, print a link for the user to login
$login_url = $facebook->getLoginUrl();
echo 'Please <a href="' . $login_url . '">login.</a>';
}
?>
</body>
</html>
我試圖/已
一)清除所有Web緩存ñ歷史(網絡瀏覽器:Firefox)
B)也被刪除Java applet和應用程序緩存
請參見網址 圖像,以獲得更多清晰的圖片
我強烈建議立即通過開發人員應用程序更改您的密鑰因爲您發佈的內容將保留在修訂歷史中)! – 2012-02-22 10:25:35
好吧,我刪除了facebook應用程序 請告訴我現在如何爲我的頁面創建一個登錄名 – 2012-02-22 12:42:24