开发者

Get logged fb user but NOT authorised the app (outside of canvas page)

开发者 https://www.devze.com 2023-01-14 17:48 出处:网络
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:

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".

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号