Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Logout in Facebook Using android fb SDK 3.0

my app using android facebook sdk 3.0,after login getting some response,after that i need to signout from facebook clicking on button.

How to log-out from the session in facebook pls help

like image 833
Nilesh Verma Avatar asked Feb 25 '13 21:02

Nilesh Verma


People also ask

How do I logout of Facebook SDK on Android?

Logout from Facebook from custom button clicklogOut(); You should also remove First name, last name, email-id etc. details from SharedPreferences if you stored it. After Facebook you will need to integrate Google login in shortly.

How do I set up Facebook SDK?

Configure Your Facebook App for Android First, log into Facebook developer account and do the following: Go to the App Dashboard; Click My Apps and create a new app; Go to Settings > Basic to see the App Details Panel with your App ID, App Secret as well as other app details.


1 Answers

You should do something like this.

if (Session.getActiveSession() != null) {
    Session.getActiveSession().closeAndClearTokenInformation();
}

Session.setActiveSession(null);

Also if you store the user token in some other way you should clear that too.

like image 134
Jorge Garcia Avatar answered Sep 25 '22 19:09

Jorge Garcia