php - Facebook SDK v4 and Graph Api 2.x auto post in Fan Page Wall -


i'm using facebook sdk 4 , graph api 2.x auto post in facebook fan page. problem post published correctly , post's configuration appears in fan page wall public i'm person can see it.

the scopes access token are: publish_pages, manage_pages, publish_actions.

and used code is:

require_once("facebook/autoload.php"); //facebook sdk v4 define('facebook_sdk_v4_src_dir', 'facebook/src/facebook/'); use facebook\facebooksession; use facebook\facebookrequest; use facebook\graphobject; use facebook\facebookrequestexception;   $app_id = 'xxxxxxxxxxxxxxxx'; //app id $app_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; //app secret //token $token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; //access token $id = "xxxxxxxxxxxxxxxxxxxxx"; // facebook page id  facebooksession::setdefaultapplication($app_id, $app_secret);  $session_facebook = new facebooksession($token);  $params = array(   "message" => 'message',   "link" => "http://www.xxxxxxxxxxx.url",   "picture" => "http://www.xxxxxxxxxxxxxxx.url/images/image.jpg",   "name" => "how auto post on facebook php",   "caption" => "www.test-url.url",   "description" => "automatically post on facebook php using facebook php sdk." ); $response = (new facebookrequest($session_facebook, 'post', '/'.$id.'/feed', $params))->execute()->getgraphobject(); 

do have suggestion?

thanks in advance sergio

if works , user can see it, forgot set app live. in app settings, go "status & review" , make sure checkbox on top set "yes". it´s right next text:

do want make app , live features available general public?


Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -