I'm using facebook sdk 3.0 to login my application. login working fine. once i logout my application it's not happening.
my logout code:
Facebook mFb=new Facebook("xxxxxxxx");
mFb.logout(this);
give me some idea to do this.
I have been facing same problem finally i found this fix
public void logout()
{
Session session = Session.getActiveSession();
if (session != null) {
session.closeAndClearTokenInformation();
}
else
{
Session session2 = Session.openActiveSession((Activity)context, false, null);
if(session2 != null)
session2.closeAndClearTokenInformation();
}
Session.setActiveSession(null);
}
I do not know whats going inside but i guess we will have to create new session if it is not found and clear token information for it. It worked for me. hope it will help.
Try this:
if( mFb.isSessionValid() ) {
mFb.logout(getApplicationContext());
SessionStore.clear(getApplicationContext());
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With