Question: Facebook: auto post on wall of a Page


Facebook: auto post on wall of a Page

Answers 0
Added at 2017-09-07 21:09

Here is a problem that drives me crazy for weeks!

For more than a year, I published automatically my website's articles on my 2 facebook Pages, directly on the wall (the main stream?). It worked like a charm. However, since March, these publications have moved to Publication->Visitors Publication (sorry for the translation but my FB is in French) so they are almost invisible!

Do you know if there was a change in FB policy regarding publishing on pages?I know that I use an old PHP SDK (3.1.1) but I can't update because of my server that doesn't have PHP 5.6! However I thing if it's a SDK version issue so the publish would be simply impossible...

Technically, a cron task on my webserver send the request with my FB App id and secret code, and use my personnal access token to publish. As I'm the admin of the pages with "manage_pages,publish_actions" rights, there was no problem. I read some topics that talk about "publish_pages" but to use this, you need to submit your App to FB for validation.

The FB support has a page that explains the differences between user and page access token. But it's unclear :

I also try to get the access token of one of my Page in but when I try to use it, I had the "(#200) The user hasn't authorized the application to perform this action".

Here is my code:

require_once dirname(__DIR__).'/include/facebook/facebook.php'; //facebook SDK
$this->oFB = new Facebook(array(
	'appId'  => self::FACEBOOK_APP_ID,
	'secret' => self::FACEBOOK_SECRET,  'cookie' => true));


$this->oFB->api('/{MyPageId}/feed', 'post',$this->FB_params);

//with FB_params populate:
$FB_params= array('access_token' => self::FACEBOOK_ACCESS_TOKEN_PERSO,
				            'from' => self::FACEBOOK_APP_ID) ;

//... and ....
$FB_params['to'] = $FB::FACEBOOK_MY_PAGEID ;
$FB_params['message'] = "blabla....." ;
$FB_params['link'] = "url..." ;

/*the way I use to get my FACEBOOK_ACCESS_TOKEN_PERSO:
1- hit :
2- hit :".FACEBOOK_APP_ID."&redirect_uri=".FACEBOOK_SECRET."&code=".$_GET['code']
3- access token-> $_GET['access_token']

Final question: Initially I had a unlimited access token now, with the same method, it is time limited to 2 months. Is it also a change in FB policy?

Sorry for this loOOOOong post but I hope you will understand that I search the web for a longtime without any solution. Thank you!

Answers to

Facebook: auto post on wall of a Page

Source Show
◀ Wstecz