dongshiran7000 2012-02-02 11:31
浏览 33
已采纳

FB应用程序中的“此帖子包含阻止的URL”错误

My webhost is 000webhost.com I've set up an FB app which needs to post on the user's wall. But FB gives this error "this post contains a blocked URL".

Here is my code

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);

What is wrong? Why am I getting this error?

  • 写回答

1条回答 默认 最新

  • duanhuangyun3887 2012-02-02 12:41
    关注

    You are not allowed to link to facebook.com. Also you dont need to set the accestoken if the user is already loggedin in your application. Try another url:

    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);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效