Search code examples
androidfacebooksdkfacebook-android-sdkfacebook-access-token

Android App FB login..


I have integrated FB sign in in my app. I am able to login to my App with FB Sign in. Even If user has signed in via FB then when he relaunches my app he does not have to login again and he is shown the landing page. For this, I have added below code:

@Override

protected void onResume() {
    super.onResume();
    if (AccessToken.getCurrentAccessToken() != null && !AccessToken.getCurrentAccessToken().isExpired()) {
        Profile profile = Profile.getCurrentProfile();
        // if the user already logged in, try to show the selection fragment
        login(profile);
    }
}

But when I relaunch my App after signing out from FB App, I am still able to login to my app and landing page (page shown after login in) is getting shown.

I want that If I have logged out of FB App, then my app should again show login page asking for log in to app using FB or via email. But even i logout from fb then also my landing page is getting launched from onResume code. What code should I add to know whether user has logged out of FB app?

Any help would be really appreciated.. !!!


Solution

  • There's no mechanism for what you're asking for.

    The FB app is disjoint from your app. It's there to be an authenticator, but once someone is logged in, then they're logged in to YOUR app, and the FB app is now out of the loop.

    Logging out (or switching users) on the FB app does not have any effect on anyone's logged in status on your app.