Facebook 应用程序错误的发帖墙
我在这里遇到问题,如果有人能回答我会很高兴 这里是 我有一个脸书应用程序。我希望该应用程序将墙发布给访问它的用户 这是我一般发布墙的代码
$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);
}
}
?>
问题是,我的墙上找不到任何帖子。而我的其他朋友使用相同的代码却成功了。
i have a problem here and i will be happy if someone can answer it
here it is
i have a facebook application. 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Kevin
您无法根据 Facebook TOS 预先填写消息参数。
看起来您正在使用旧版本的 php-sdk。
建议 - 尝试使用新的 sdk,并将您的应用程序设置设置为使用 OAUTH2.0
Kevin
You can not prefill the message param according to Facebook TOS.
It looks as though you are using an older version of php-sdk.
A suggestion - Try using the new sdk, and setting your app setting to use OAUTH2.0