skip to Main Content

I created a facebook app in order to use it as a login for my website.
I wish to use this app to get my page likes count, and offline post to this page.
I’m the admin of both the page and the application.
I don’t want to take any actions with my users pages. only my page.
do I still need the manage_page permission?

this is the code i’m trying using the app token that I am getting from the graph API explorer

$fb = new FacebookFacebook([
            'app_id' => '1111111111111111111111',
            'app_secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx',
            'default_graph_version' => 'v3.2',
        ]);

        try {
              // Returns a `FacebookFacebookResponse` object
              $response = $fb->get(
                '/252525x25252x525252x5252525/likes',
                'apptokenapptokenapptokenapptoken'
              );
            } catch(FacebookExceptionsFacebookResponseException $e) {
              echo 'Graph returned an error: ' . $e->getMessage();
              exit;
            } catch(FacebookExceptionsFacebookSDKException $e) {
              echo 'Facebook SDK returned an error: ' . $e->getMessage();
              exit;
            }
            $graphNode = $response->getGraphNode();


                 var_dump($graphNode);  

but i’m getting this error:

Graph returned an error: (#10) To use ‘Page Public Content Access’,
your use of this endpoint must be reviewed and approved by Facebook.
To submit this ‘Page Public Content Access’ feature for review please
read our documentation on reviewable features:
https://developers.facebook.com/docs/apps/review.

When I tried to get page access token from graph api explorer using a different browser on mobile phone I get this,

ee

2

Answers


  1. Yes, you need to authorize with the manage_pages permission, and you have to use a Page Token of the page in question to get data. With the App Token, you would need to get Page Public Content Access approved.

    More information: https://developers.facebook.com/docs/facebook-login/access-tokens#pagetokens

    Login or Signup to reply.
  2. No, if you want to just access your page, you can do it without going through app review. Users with developer access to the app bypass (most of) app review.

    Your issue is here:

    apptokenapptokenapptokenapptoken
    

    This exemption does not apply to access via an app-level token. Use a Page-level access token acquired from a user of the app with developer privileges. (This is pretty easily done via https://developers.facebook.com/tools/explorer/ – just click “Get Token” and then “Get Page Access Token”.)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search