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 thou开发者_如何学Pythonght 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
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".
精彩评论