简体   繁体   English

facebook 应用程序错误的发布墙

[英]posting wall for facebook application error

i have a problem here and i will be happy if someone can answer it here it is i have a facebook application.我在这里遇到问题,如果有人可以在这里回答,我会很高兴,因为我有一个 facebook 应用程序。 I want that application to post wall to user who access it this is my code for posting wall in general我希望该应用程序向访问它的用户发布墙这是我发布墙的一般代码

$facebook = new Facebook(array(
  'appId'  => '183548958372557',
  'secret' => '5243d800bb7ef208e39aec73c03fc33f',
  'cookie' => true,
));

// cek uda login pa lom, kalo lom redirect ke login url
$session = $facebook->getSession();
if (!$session) {
    $url = $facebook->getLoginUrl(array(
        'canvas' => 1,
        'fbconnect' => 0,
        'req_perms' =>  'email,publish_stream,status_update,user_birthday,user_location,user_work_history'
    //permission utk aplikasi --> penting
    ));

   echo "<script type='text/javascript'>top.location.href = '$url';</script>";
    die();
}
if($_POST['komen']!="") {
        try {
            $args =  array(
                        'message' => 'FoodSeeker: ' . $_POST['komen'],
                            'link' => 'http://apps.facebook.com/foodseeker',
                        'name' => 'Makan :p',
                        'picture' => 'http://freshread.files.wordpress.com/2010/12/angel.jpg',
                        'caption' => 'Dibuat oleh orang lapar dan untuk orang lapar'
);
            $result = $facebook->api('/me/feed', 'post', $args);
        } catch (FacebookApiException $e) {
            echo 'Error: ' . print_r($e, true);
        }
}
?>

the problem is, i can't get any post in my wall.问题是,我的墙上没有任何帖子。 While my other friends that use the same piece of code succeeds.而我其他使用相同代码的朋友成功了。

Kevin凯文

You can not prefill the message param according to Facebook TOS.您不能根据 Facebook TOS 预填充消息参数。
It looks as though you are using an older version of php-sdk.看起来好像您使用的是旧版本的 php-sdk。

A suggestion - Try using the new sdk, and setting your app setting to use OAUTH2.0一个建议 - 尝试使用新的 sdk,并将您的应用设置设置为使用 OAUTH2.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM