Post to Facebook application page as APPLICATION user

I would like to write a status message to my application page with the name of the application.

I use

$app_id = 'ID OF MY APPLICATON'
$facebook->api($app_id.'/feed', 'POST', array('message' => 'test'));

After the message is written, my name is displayed, but instead of the name I need to specify the name of the application that will be shown, is it possible to do this?

+3
source share
1 answer

Application pages work just like fan pages, so you just do the same thing as if you would like it to be sent to a fan page

Information here - http://www.masteringapi.com/tutorials/how-to-post-on-facebook-page-as-page-not-as-admin-user-using-php-sdk/31/

access_token , access_token

$result = $facebook->api("/me/accounts");
foreach($result["data"] as $page) {
    if($page["id"] == $page_id) {
        $page_access_token = $page["access_token"];
        break;
    }
}
$args = array(
    'access_token'  => $page_access_token,
    'message'       => "I'm a Page!"
);
$post_id = $facebook->api("/$page_id/feed","post",$args);
+4

Source: https://habr.com/ru/post/1782074/


All Articles