tags:

views:

58

answers:

1

Alright, looking at the JS SDK there is this:

auth.statusChange

Typically you will want to use the auth.sessionChange event. But in rare cases, you want to distinguish between these three states:

  • Connected
  • Logged into Facebook but not connected with your application
  • Not logged into Facebook at all.

So I would be using

FB.Event.subscribe('auth.sessionChange', function(response) {
    // do something with response
    console.log (response)
});

You'd have thought this is exactly what I need, but guess what. Even if I satisfy the condition :

  • Logged into Facebook but not connected with your application

I'm still getting session = null!

Can anyone please suggest a way of getting the session of a logged in user but hasn't yet approved the app.

Thanks

+1  A: 

Can't get session unless the user approved your app.

You can use http://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus to see if user logged in, but not connected.

"The status of the User. One of connected, notConnected or unknown".

Denis
But what I want to do is ultimately get the userid of the connected user. I have used this before and all it gives me is status: not connected, although I am connected into FB in another tab.
PaulM
notConnected => user is logged in Facebook, but not connected to your app. I am about 80% sure you can't get userid with js sdk if the user did not authorize your app.
Denis
thanks for replying, I kinda figured this was the case. its a shame thought as I thought I recalled that you were able to determine which fb user was connected.
PaulM

related questions