Facebook post on wall page - PHP SDK

I am trying to create a script for this post on the facebook (as administrator) status page. This is the script I use:

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 works and I see a message on facebook (ignore language): enter image description here

The problem is that I am the only one who can see this post. When other users enter the page, they cannot see the message, and if I give them the URL, it says that it does not exist.

+4
source share
1 answer

You need to make your application public, in addition to the Status and Browse tabs in the application panel.

, , Facebook, //.

( , , . , .)

0

All Articles