Checking if the user is logged in on Facebook even before calling facebook.login() ?

Hi,

we are designing a page in our game. If the user is not logged in on Facebook, we’d like to show the default page along with a message “Log in to Facebook to see …”

If the user is already logged in, we’d like to show a specific page for the user.

This means that we would need to know if the user is logged in or not even before calling facebook.login() method. Is it possible to do? If so, how do we do it?

Thanks.

[import]uid: 120903 topic_id: 33122 reply_id: 333122[/import]

You know if you’ve called login or not. You know if you’ve done an initial Facebook SSO (where it asks for permission) as well. You just need to save a setting indicating if you’ve ever logged in and then you know you’ve done the first SSO and then you can keep track of if you’re logged in or not.

[import]uid: 19626 topic_id: 33122 reply_id: 131513[/import]

You know if you’ve called login or not. You know if you’ve done an initial Facebook SSO (where it asks for permission) as well. You just need to save a setting indicating if you’ve ever logged in and then you know you’ve done the first SSO and then you can keep track of if you’re logged in or not.

[import]uid: 19626 topic_id: 33122 reply_id: 131513[/import]

But if access token is expired or user revoked the permission, how do we know that unless we call facebook.login() again?

I guess for the most cases, it will be okay to save whether or not the user did the first SSO and use it to keep track of the user’s login status, but I was wondering if there is a more solid approach.

[import]uid: 120903 topic_id: 33122 reply_id: 131579[/import]

I’m not aware of one. [import]uid: 19626 topic_id: 33122 reply_id: 131598[/import]

But if access token is expired or user revoked the permission, how do we know that unless we call facebook.login() again?

I guess for the most cases, it will be okay to save whether or not the user did the first SSO and use it to keep track of the user’s login status, but I was wondering if there is a more solid approach.

[import]uid: 120903 topic_id: 33122 reply_id: 131579[/import]

I’m not aware of one. [import]uid: 19626 topic_id: 33122 reply_id: 131598[/import]

@loophin Did you ever figure this out?

@loophin Did you ever figure this out?