I\'m have a feature on my Android app where the user authorizes the app and shares a link.
I also need to give an option for the user to logout of facebook and I nee
For Facebook Android SDK 4.x you have to use the "AccessToken.getCurrentAccessToken()" as said by @Diljeet but his check didn't work for me, I finally checked it by doing:
Activity "onCreate":
facebookAccessToken = AccessToken.getCurrentAccessToken();
To check if the session is still active (I made it in the "onResume" method but do it where you need):
if(facebookAccessToken != null){
sessionExpired = facebookAccessToken.isExpired();
}else{
sessionExpired = true;
}
More info in https://developers.facebook.com/docs/facebook-login/android