2

I searched all web long for this problem but nothing seems to fix it.

I am simply writing a post to a facebook page, the post is visibile on the page but only by myself and no from other admins or users.

How can it be possible?

I am using this function (also i'm pretty sure that the whole code is working as the post is on the page!):

$postResult = $facebook->api($post_url, 'post', $msg_body );

First i was guessing that was a privacy problem, but the page doesn't have that kind of parameter.

Whole code is:

post_url = '/'.$page_id.'/feed';

$page_info = $facebook->api("/$page_id?fields=access_token");

//die(print_r($page_info));
//posts message on page statues 
$msg_body = array(
'access_token' => $page_info['access_token'],

'message' => "test"
);

if ($fbuser) {
  try {
        $postResult = $facebook->api($post_url, 'post', $msg_body );
    } catch (FacebookApiException $e) {
    echo $e->getMessage();
  }
} 

@------------@ EDIT @------------@

I still have the same problem, also, i checked a feed "manually" posted and a feed from my script, and the fields are exactly the same... that's insane.

@------------@ EDIT II: @------------@

I tried with a curl, nothing seems to work :/

4

2 回答 2

2

问题已解决。

作为一个白痴,沙盒模式被激活(我不知道应用程序所做的一切都是由沙盒绑定的)。

于 2013-03-23T14:45:19.613 回答
0

您需要某种页面访问令牌才能做到这一点。另外,$post_url, 代表什么?我们无法从您编写的代码中猜测。无论如何,您可以使用$pageid/feed或使用me/feed(以及访问令牌)发布。它应该是这样的$facebook->api( '/me/feed/', 'post', array('access_token' => $page_access_token, 'message' => 'Test message', 'link' => 'http://somelink.com') );

于 2013-03-20T19:37:09.993 回答