How can I fix 'active access token must be used' error when getting list of Facebook pages a user is managing?

72 Views Asked by At

I am trying to implement the flow described here and here

I finish the first step (in Flutter) and retrieve the user access token via Facebook Auth. Then I move to the next step, getting a list of pages that this user is managing

var url = Uri.https('graph.facebook.com','/me/accounts?access_token=<AccessToken>');

var response = await http.get(url);

The result is always:

Response body: {
   "error": {
      "message": "An active access token must be used to query information about the current user.",
      "type": "OAuthException",
      "code": 2500,
      "fbtrace_id": "AzCDdgD0ejBmDwdUigE4ugR"
   }
}

When I run the same query in the Graphi API Explorer, it works fine (with the same access token). The only difference between the code version and explorer version is the business_management permission, but I am not sure if I can set that in my Meta App since it is in Development state

Screenshot

I have also tried other options described in the api. Unfortunately nothing works.

Anyone here got this working? Thanks in advances for any hints in the right direction.

Graph Explorer

0

There are 0 best solutions below