我的网站主机是000webhost.com 我已经设置了一个FB应用程序,需要在用户的墙上发布。但FB给出了这个错误 “此帖子包含已阻止的网址”。
这是我的代码
require_once("facebook.php");
$facebook = new Facebook(array( 'appId' => $app_id, 'secret' => $app_secret, 'cookie' => true ));
$attachment = array(
'access_token' => $params['access_token'],
'message' => "Hello, here is a post",
'name' => "",
'link' => "http://www.facebook.com",
'description' => "Write here your description",
);
$result = $facebook->api('/me/feed', 'POST', $attachment);
有什么问题?为什么我会收到此错误?
答案 0 :(得分:1)
您不能链接到facebook.com。如果用户已经在您的应用程序中登录,您也不需要设置accestoken。尝试其他网址:
require_once("facebook.php");
$facebook = new Facebook(array( 'appId' => $app_id, 'secret' => $app_secret, 'cookie' => true ));
$attachment = array(
'message' => "Hello, here is a post",
'name' => "",
'link' => "http://www.example.com",
'description' => "Write here your description",
);
$result = $facebook->api('/me/feed', 'POST', $attachment);