raki
raki

Reputation: 2293

Uncaught OAuthException Error with Facebook PHP api

I am using php SDK of FB (version 3.2.0) for my application for FB Login and when i tried to get the userid using facebook->getUser() methode , its returns the user id , but when i triedto get the user data using facebook->api('/me') methode it returns the error

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

Both are working if am not logged into FB and getting logged through the FB login link . If am logged into FB and tried to get the user data , it always result in the error

Please help me

Upvotes: 1

Views: 506

Answers (1)

yacon
yacon

Reputation: 1122

Check for the user_id first and if it's null reauthorize the user as shown in the following example: http://developers.facebook.com/docs/reference/php/facebook-api/

Upvotes: 1

Related Questions