As you know that Facebook upgraded it API to V3.1 and now killing old APIs and Apps slowly so we have to migrate on there new API where they took some hard decision that is good on SPAM site but hard for developers too.
Reminder: Graph API v2.7 will be deprecated on Oct 05, 2018. Please use the API Upgrade Tool to understand how this might impact your app. For more details see the changelog
Now I created a new FB app with some settings as shown in the below screenshots to Post On My Own Pages not Profile but got errors that is mentioned below too.
And then I used the below code to post on my own page where I am Owner from same account where I created this Apps.
<?php
$page_access_token = 'GENERAL_ACCESS_TOKEN';
$page_id = 'OWN_PAGE_ID';
// From https://developers.facebook.com/tools/explorer
$data['message'] = "Text_Message";
//$data['picture'] = "http://www.example.com/image.jpg";
//$data['link'] = "http://www.example.com/";
//$data['caption'] = "Caption";
//$data['description'] = "Description";
$data['access_token'] = $page_access_token;
$post_url = 'https://graph.facebook.com/'.$page_id.'/feed';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $post_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$return = curl_exec($ch);
echo $return;
curl_close($ch);
?>
Now when I run upper code, I got the below error...
{"error":{"message":"(#200) Requires either publish_to_groups permission and app being installed in the group, or manage_pages and publish_pages as an admin with sufficient administrative permission","type":"OAuthException","code":200,"fbtrace_id":"XXXXXXXXX"}}
Now my question is from where I can allow my Apps these permission because where I allowed all didn't see these names (publish_to_groups
, manage_pages
and publish_pages
etc) as shown in the above last screenshot.
Note: Everything I created and Code now so I need solution working with newly released API 3.1.
UPDATE:
My friend told me to allow all permission to get my code working as shown in the below screenshot but I am not able to view these permission in my apps. I need all these. How to get them?