Facebook login Facebook Logout
This site uses cookies to deliver our services and to show you relevant ads and job listings. By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. Your use of Stack Overflow’s Products and Services, including the Stack Overflow Network, is subject to these policies and terms.
Join Stack Overflow to learn, share knowledge, and build your career.
Facebook SDK 4 for Android - how to log out programmatically
Ask Question
up vote 94 down vote favorite
Recently, Facebook released SDK 4 with new and cool updates. I tried to switch into SDK4 to use new features, however, I am struggling with the Login feature of Facebook.
So far, to log out Facebook programmatically, I used :
But SDK4 seems not to support Session anymore, and in official docs, they mention:
There are two ways to implement Facebook login on Android:
LoginButton class - Which provides a button you can add to your UI. It follows the current access token and can log people in and out.
Well, seems there's no way to log out Facebook programmatically except using LoginButton. Anyone have any idea, please share it here.
android facebook facebook-sdk-4.0
You can use LoginManager.getInstance().logOut();, even if you use LoginButton because
This UI element wraps functionality available in the LoginManager.
EDIT: Just to mention that this works for Facebook SDK v4. I don't know if they will change it in the future.
@as batoutofhell mention, don't forget to put FacebookSdk.sdkInitialize(getApplicationContext()); to initialize the facebook sdk. Please see here for the details.
This site uses cookies to deliver our services and to show you relevant ads and job listings. By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. Your use of Stack Overflow’s Products and Services, including the Stack Overflow Network, is subject to these policies and terms.
Join Stack Overflow to learn, share knowledge, and build your career.
Facebook SDK 4 for Android - how to log out programmatically
Ask Question
up vote 94 down vote favorite
Recently, Facebook released SDK 4 with new and cool updates. I tried to switch into SDK4 to use new features, however, I am struggling with the Login feature of Facebook.
So far, to log out Facebook programmatically, I used :
But SDK4 seems not to support Session anymore, and in official docs, they mention:
There are two ways to implement Facebook login on Android:
LoginButton class - Which provides a button you can add to your UI. It follows the current access token and can log people in and out.
Well, seems there's no way to log out Facebook programmatically except using LoginButton. Anyone have any idea, please share it here.
android facebook facebook-sdk-4.0
Related Posts:
- How do i retrieve deleted Facebook Messages
- I cant add my friend on Facebook
- How to sign in Facebook Page
- How to edit name on facebook Page
- Facebook email log7n
- What is a poke mean on Facebook
- Facebook grid Search
- View deactivated Facebook Profile
- Facebook website log In
- Facebook registration form Application
You can use LoginManager.getInstance().logOut();, even if you use LoginButton because
This UI element wraps functionality available in the LoginManager.
EDIT: Just to mention that this works for Facebook SDK v4. I don't know if they will change it in the future.
@as batoutofhell mention, don't forget to put FacebookSdk.sdkInitialize(getApplicationContext()); to initialize the facebook sdk. Please see here for the details.
0 comments:
Post a Comment
Facebook has greatly reduced the distribution of our stories in our readers' newsfeeds and is instead promoting mainstream media sources. When you share to your friends, however, you greatly help distribute our content. Please take a moment and consider sharing this article with your friends and family. Thank you.