2011-10-05 44 views
-5

我從Facebook獲取示例代碼以發佈消息。起初它工作正常。第二天我試圖清理代碼並停止工作。我帶回了Facebook上的示例代碼,將我所做的所有更改都拿出來了,但仍然無法使用。Facebook狀態更新代碼無法更新牆壁

我把打印語句放在代碼後面。

$user_id是錯誤的,所以它顯示登錄。登錄不再進入屏幕登錄。它會調用我的返回URL,然後將$user_id視爲錯誤,並再次登錄。

我沒有通知我的回調正在調用的時候,我有以下值:

v =狀態452c9492a3d51962909f5e000bcb0965

和代碼

碼= AQDucDgsdc3lZFVN2MC3Oj2oB0n1LT4FjOrG3MbgwL4uhh- -LS-mRdtjU-6oSUZxsR6UhTKuUDVn3hrasJAe5r1I6ksIDJz1nnTo1mjCqEInJKvQ2qK5A-N3_Nt5buGLqsirb8ccg21N4nWVWkk_iRePwX9f68qK1j-2O6E_USpKvRJeNP3bcwLBiTBJpDVu7aA#=

我在想,也許當我試圖清理代碼,並不停地運行它,Facebook的標記我的應用程序爲垃圾郵件?我張貼了26篇文章到我的牆上 - 這太多了嗎?如何檢查我的應用是否被標記爲垃圾郵件應用?

這是我用

<? 
// 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('facebook.php'); 

$config = array(
    'appId' => 'myappid', 
'secret' => 'mysecret', 
); 

$facebook = new Facebook($config); 
$user_id = $facebook->getUser(); 
?> 
<html> 
<head></head> 
<body> 

<? 
if($user_id) { 
    print ("tryinmg to do a poast"); 
    // We have a user ID, so probably a logged in user. 
    // If not, we'll get an exception, which we handle below. 
    try { 
     $ret_obj = $facebook->api('/me/feed', 'POST', 
           array(
            'link' => 'www.example.com', 
            'message' => 'Posting with the PHP SDK!' 
          )); 
     echo '<pre>Post ID: ' . $ret_obj['id'] . '</pre>'; 

    } 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. 
     print ("face book exception log in"); 
    $login_url = $facebook->getLoginUrl(array(
        'scope' => 'publish_stream' 
        )); 
     echo 'Please <a href="' . $login_url . '">login.</a>'; 
     error_log($e->getType()); 
     error_log($e->getMessage()); 
    } 
    // Give the user a logout link 
    echo '<br /><a href="' . $facebook->getLogoutUrl() . '">logout</a>'; 
} else { 
    print ("no user login in do login"); 
    // No user, so print a link for the user to login 
    // To post to a user's wall, we need publish_stream permission 
    // We'll use the current URL as the redirect_uri, so we don't 
    // need to specify it here 
    $login_url = $facebook->getLoginUrl(array('scope' => 'publish_stream')); 
    echo 'Please <a href="' . $login_url . '">login.</a>'; 
} 

?> 
</body> 
</html> 
+4

沒有任何編輯將使我能夠理解這個問題。 – doctorless

+0

-1完全無法理解,標題聽起來像是一個2歲的尖叫。 –

回答

0

當然,Facebook has a limit for the number of post per day您的應用程序可以讓用戶牆上的示例代碼。而FB也有用戶報告垃圾郵件應用的政策。

帖子的確切最大數量取決於您的應用程序的FB排名。根據我的經驗,用戶牆上的26個帖子接近新應用的限制。

如果是這樣的話,您會收到來自Facebook,它說類似的錯誤消息「您已達到崗位的限制......」

P/S:看來你需要時間來重構你的問題,但是。如果我以前沒有遇到過這種情況,我不會理解你的問題。