Auto post facebook in php -
i using following code auto post on facebook, shows me oauthexception
.
$user_id = $facebook->getuser(); $page_info = $facebook->api("/page_id?fields=access_token"); try { $ret_obj = $facebook->api( '/page_id/feed', 'post', array ( 'link' => 'http://www.example.com/', 'message' => 'this test', 'access_token' => $page_info['access_token'] ) ); } catch(facebookapiexception $e) { $login_url = $facebook->getloginurl(array( 'scope' => 'publish_stream' )); print_r($e->gettype()); print_r($e->getmessage()); }
error:
fatal error: uncaught oauthexception: (#100) tried accessing nonexisting field (access_token) on node type (user) thrown in /home/malwatal/public_html/basic/lib/base_facebook.php on line 1028
now it's time use facebook v5 sdk
$fb = new facebook\facebook([ 'app_id' => 'app_id', 'app_secret' => 'app_secret', 'default_graph_version' => 'v2.8', ]); // facebook auto post $params = array( "message" => "$title in $merchant $short", "link" => "http://pickmyoffers.com/", "picture" => "http://pickmyoffers.com/images/searched/flipkart.png", "name" => "www.pickmyoffers.com", "caption" => "www.pickmyoffers.com", "description" => "submit coupon , earn money through pickmyoffers.com | deals,coupons , offers." ); $post = $fb->post('/page_id/feed',$params, $access_token); $post = $post->getgraphnode()->asarray(); }
hope it's help
Flipkart Sbi Offers,Flipkart Hdfc offer
ReplyDeleteFlipkart sbi Offers =10% cashback
Flipkart hdfc
ReplyDeleteFlipkart hdfc offer
Hdfc debit card emi flipkart
Hdfc credit card offer on flipkart
Flipkart hdfc debit card emi
Hdfc debit card emi on flipkart
Flipkart hdfc offer 2021
Flipkart debit card emi hdfc
Hdfc smartbuy flipkart
Hdfc flipkart offer 2021
Flipkart hdfc offer terms and conditions
Hdfc bank flipkart offer
hdfc flipkart offer 2021
Flipkart big shopping days hdfc offer
Debit card emi hdfc flipkart
Hdfc debit card emi in flipkart
Flipkart hdfc credit card
Smartbuy flipkart hdfc
Hdfc debit card emi eligibility check flipkart
Hdfc 10 instant discount flipkart
Hdfc discount on flipkart
Flipkart debit card emi hdfc eligibility
Hdfc flipkart credit card
Flipkart hdfc debit card emi eligibility
Hdfc credit card offers on flipkart 2021
Flipkart hdfc offer may 2021
Emi on hdfc debit card flipkart
Flipkart hdfc debit card offer
Hdfc no cost emi flipkart
Hdfc flipkart smartbuy
Hdfc card offer on flipkart
Hdfc debit card emi offers on flipkart