I am using Facebook Login Button to integrate Facebook Login to my app.
When i press Facebook Login Button , it authenticates my Credentials and if successfully done , then change text to Log Out & Go inside my app.
Now when i use app and i go out of App and when i again come back to Login Screen. Here i see logout - As i authenticate myself before and i didn't logout.
So My question is how to differentiate when i am already logged in or my session is expired ?
Here is a code i am using:
LoginButton authButton;
authButton = (LoginButton) findViewById(R.id.authButton);
// set permission list, Don't forget to add email
authButton.setReadPermissions(Arrays.asList("basic_info", "email"));
authButton.setSessionStatusCallback(new Session.StatusCallback() {
@Override
public void call(Session session, SessionState state,
Exception exception) {
authButton.setReadPermissions(Arrays.asList("basic_info",
"email"));
System.out.println("Inside Call");
if (session.isOpened()) {
fbToken = session.getAccessToken();
}
}
});
.....................................
Thank you very much in advance.
Regards, Rakesh