Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook android sdk 3.0 SSO

In previous versions of the Facebook SDK we could check if a user is still signed in by using tokens. In the new 3.0 version I can't find another way other than invoking openSession() to check if the user is still logged in with SSO. But openSession() automatically invokes the login if the user is not saved and I don't want that. I only want to check SSO. How do I do this?

like image 727
Cookie Monster Avatar asked Oct 25 '12 15:10

Cookie Monster


1 Answers

I made a helper function that to check if the user is still logged in (or actually has an active session) for me in my app:

public static boolean isActive() {
    Session session = Session.getActiveSession();
    if (session == null) {
        return false;
    }
    return session.isOpened();
}
like image 97
Daniel Backman Avatar answered Sep 20 '22 20:09

Daniel Backman