Search code examples
androidfacebookandroid-simple-facebook

SimpleFacebook isLogin returns true even when I logout from Facebook app on device


I have integrated SimpleFacebook on Android in my application. It works most of the times, except for one use-case. Suppose I start my app, and then, log - out from Facebook app on device. Then, I come back to my app, and try to log-in using Facebook SDK. The app is not detecting that I am logged out of Facebook app on the device. The cause for this, is that, SimpleFacebook API isLogin() is returning true.

Is this a known issue? I am using SimpleFacebook and Facebook SDK version 3.5.2.


Solution

  • This is a Facebook issue You need to clear the Session token cache that is in local memory. So place this before login

    Session ses = mSimpleFacebook.getSession();
    ses.closeAndClearTokenInformation();
    

    I wonder why the -1 in the question