I'm trying to create a script that post on a facebook page (as an administrator) a status. This is the script i'm using:
try {
$access_token = (new FacebookRequest( $session, 'GET', '/' . $pageID, array( 'fields' => 'access_token' ) ))
->execute()->getGraphObject()->asArray();
$access_token = $access_token['access_token'];
$page_post = (new FacebookRequest( $session, 'POST', '/'. $pageID .'/feed', array(
'access_token' => $access_token,
'message' => $message,
) ))->execute()->getGraphObject()->asArray();
} catch (FacebookRequestException $e) {
echo 'ERROR! ' . __LINE__ . $e->getMessage();
} catch (Exception $e) {
echo 'ERROR! ' . __LINE__ . $e->getMessage();
}
The script does work, and I see the post on facebook (ignore language):
The problem is that I'm the only one who can see this post. When other users enter the page, they can't see the post, and if I give them the post's url, it says that it doesn't exist.