• Register
1 vote
43 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. With this access token, I am able to access the users public info just fine. But when I want to post info to their Face Book account I am facing below error :

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

6 5 3
7,540 points

1 Answer

0 votes

Solution :

I had faced the similar issue and it was because I was trying to save the access token but I was not using it. It could be because I just did not think about it in the past. But in case anyone else is in the same situation to fix that follow below procedure :

When I log in the user account for which I have saved the access token:

$facebook = new Facebook(array(

  'appId' => <insert your app id you get from facebook here>,

  'secret' => <insert your app secret you get from facebook here>

));

$accessToken = $facebook->getAccessToken();

//save this access token for later

Now when I try to make the requests to the facebook I just do something like below:

$facebook = new Facebook(array(

'appId' => <insert your app id you get from facebook here>,

'secret' => <insert your app secret you get from facebook here>

));

$facebook->setAccessToken($accessToken);

$facebook->api(... insert your code here ...)

9 7 4
38,600 points

Related questions

0 votes
1 answer 48 views
48 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 ... 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.
asked Jan 10 alecxe 7.5k points
1 vote
1 answer 39 views
39 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 morrisBson 3.2k points
0 votes
1 answer 45 views
45 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 jwilliam 3.9k points
0 votes
1 answer 24 views
24 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 Raphael Pacheco 4.9k points