Saturday, July 16, 2022

[FIXED] How to detect logout event with the Facebook Android API v4?

Issue

I post here because I've got a problem. I'm working on a new android application , and I want to know how I can detect when a user is disconnecting (facebook logout button), because I want to refresh my UI at this moment.

I have been watched the official documentation, but I found nothing.


Solution

You can try this also

 if(AccessToken.getCurrentAccessToken()!=null)
 {
   Log.v("User is login","YES");

 }
else
{
         Log.v("User is not login","OK");
      LoginManager.getInstance().logInWithReadPermissions(WelcomeActivity1.this, (Arrays.asList("public_profile", "user_friends","user_birthday","user_about_me","email")));
 }


Answered By - Anny
Answer Checked By - Timothy Miller (PHPFixing Admin)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.