• Register
0 votes
97 views

Problem :

I am struggling to find out what is actually happening with my code. My scripts were working fine for some time and suddenly they have half stopped.

I am trying to access my api and I am getting back the access token. With my access token, I can access the users public info just correctly. But, when I want to post any info to their FB account I face below error.

Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user.

Any idea regarding this what is happening with my code? I am also trying to use sessions on the site to keep track of the internal user ids. Unable to know if my sessions could be causing the problem.

6 5 3
7,540 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I also had the similar issue in the recent past, and it was happening because I was just saving my access token but was not using it. It may be because I had made some silly mistakes because of the due dates pressure, or maybe I just forgot about it! But in any case anyone else is in a same situation:

Now whenever I log in as user I save my access token as below :

$facebook = new Facebook(array(
'myappId' => <insert the app id which you got from facebook here>,
'mysecret' => <insert the app secret which you got from facebook here>
));
$myaccessToken = $facebook->getAccessToken();
//save your access token for later

 

9 7 4
38,600 points

Related questions

1 vote
1 answer 106 views
106 views
Problem : Currently I am struggling to find out what is actually happening with my code. My all scripts were working really fine previously but now they are suddenly half stopped. I am trying to access the api but I am getting back the access token. ... am facing below error : Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user.
asked Dec 30, 2019 alecxe 7.5k points
1 vote
1 answer 63 views
63 views
Problem : I am very new to Facebook programming. Currently I want to run a very simple code for Facebook connect which I have already written but now a days I often face below error message : [error] => Array             (                 [message] => An active ... I want expert help here to fix above error as I have already wasted couple of days in debugging above error but no successes yet.
asked Apr 8, 2020 morrisBson 3.2k points
0 votes
1 answer 59 views
59 views
Problem : I am very new to SQL.I and my colleague have recently joined SQL project now I have a table on my SQL Server and I want to export the structure of the table so that I can send it to my colleague. Which SQL command should one fire to get the required table structure? Please note that I don't have any access to the SQL Server Management Studio.
asked Jan 27, 2020 jwilliam 3.9k points
0 votes
1 answer 66 views
66 views
Problem: I am new to Geocoding. I want to program the geocoding. I have already created the API key but if I add it into my current website code then surprisingly I do not get anything and if I do not use the API then somehow everything starts working again. Whenever ... Google Maps Geocoding API is turned on. Kindly tell me if the API key has to be activated also somewhere else to make it work?
asked Jun 17, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 9.4K views
9.4K views
Problem : When going to one of the Facebook page: I face the below message: This page isn't available The link you followed may be broken, or the page may have been removed I seriously want to claim the name of that page for my facebook page, but I don't know what a message means, or if I can even claim the page?
asked Feb 3, 2020 jwilliam 3.9k points
0 votes
1 answer 444 views
444 views
Problem : Currently I am trying to display a JSON content using a API key. But I am unable to get a authentication. I am facing below error in my JsonObject: &ldquo;Org.json.JSONException: Value Authorization of type java.lang.String cannot be converted to JSONObject&rdquo; In my ... to pass a API key and URL id to get my JSON response in a URL. I display a JSON content using a JSON array.
asked Feb 2, 2020 jwilliam 3.9k points
0 votes
1 answer 9 views
9 views
Problem: this page does not have permission to install the custom tab.
asked Feb 16 Ethan ross 1.8k points
0 votes
1 answer 977 views
977 views
Problem : I have my facebook messenger application. It has the webhook subscribed to the page events. It used to work fine for me until few days ago, when a webhook was unsubscribed from the page and when I am trying to subscribe it again then it tells me: "Insufficient ... action." I am the owner and admin on both of the FB page and messenger app. Does somebody know what could be a problem?
asked Feb 4, 2020 jwilliam 3.9k points
0 votes
1 answer 10 views
10 views
Problem: yarn' is not recognized as an internal or external command, operable program or batch file.
asked Feb 18 Lucky Guy 1.4k points