我从Facebook获取示例代码以发布消息。起初它工作正常。第二天,我试图清理代码,它停止工作。我从Facebook带回了示例代码,取出了我的所有更改,但它仍然无效。
我输入了打印语句来遵循代码。
$user_id
为false,因此显示登录信息。登录信息不再进入屏幕登录状态。它会调用我的返回网址,然后将$user_id
视为false并再次登录。
我确实注意到在调用我的回叫时,我有以下值:
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>
答案 0 :(得分:0)
当然,Facebook has a limit for the number of post per day您的应用可以创建用户墙。 FB也有政策让用户报告垃圾内容的应用程序。
确切的最大帖子数取决于您的应用程序FB排名。根据我的经验,用户墙上的26个帖子接近新申请的限制。
如果是这种情况,您应该收到来自Facebook的错误消息,其中写着“您已达到帖子限制......”
P / s:看来你需要时间来重构你的问题。如果我之前没有遇到过这种情况,我将不理解你的问题。