How my app can know when user logout from its native Facebook app ?
I am using below code for Logging out from Facebook in my app. And it is working fine.
on destroy you clear the session and token information so that if you logout from your native application .. it will clear its credentials
use this
@Override
protected void onDestroy() {
// TODO Auto-generated method stub
super.onDestroy();
Session session = Session.getActiveSession();
session.closeAndClearTokenInformation();
}
OR
public void logoutFromFacebook() {
mAsyncRunner.logout(this, new RequestListener() {
@Override
public void onComplete(String response, Object state) {
Log.d("Logout from Facebook", response);
if (Boolean.parseBoolean(response) == true) {
// User successfully Logged out
}
}
@Override
public void onIOException(IOException e, Object state) {
}
@Override
public void onFileNotFoundException(FileNotFoundException e,
Object state) {
}
@Override
public void onMalformedURLException(MalformedURLException e,
Object state) {
}
@Override
public void onFacebookError(FacebookError e, Object state) {
}
});
}
try this it works for me .. so it will also resolve your issue also