Dmitry
Dmitry

Reputation: 976

Unable to get user info with facebook JS SDK

Possibly the question is being solved somewhere, but I can't find the solution.

The problem is following:

  1. There was created Facebook application for web-sites. Application ID: 838914722867595

  2. All setting were set to "public" for the application. I.e. the status is "This app is public and available to all users"

  3. When trying to get user info with not application owner account with "FB.api('/me', ... " I've got an error:

{ status="not_authorized", authResponse=undefined}

{ message="An active access token must be used to query information about the current user.", type="OAuthException", code=2500}

I need only Facebook user ID.

Calling of "FB.api('/me', ..." is wrapped into "FB.getLoginStatus( ..."

  1. Doing the same with application owner account returns the expected user info results.

{ authResponse={...}, status="connected"}

{ id="1395024780825585", first_name="Evgeny", gender="male", more...}

  1. The url with implemented Facebook JS: http://www.doc4net.com/download/2459616413282

Here is the screenshot of the app setting.

enter image description here

Please, advice

Upvotes: 0

Views: 139

Answers (1)

Dmitry
Dmitry

Reputation: 976

The issue is solved.

Facebook "Like" button DOES NOT provide application permissions on login. Even it is calling the login dialog.

So, first the one is need to be logged in with "Log in" button, which rises the login dialog with requesting to allow application permissions to read facebook user info.

Only after using "Log in" the "Like" button works properly.

Upvotes: 0

Related Questions