Reputation: 1726
I am trying to integrate my app to twitter and I do it
but my question is: How I can logout from twitter? can I remove RequestToken or OAuth of my app?
I tried to use:
twitter.setOAuthAccessToken(null);
but does not work
also does not work
please help me
thanks in advance
Upvotes: 4
Views: 1593
Reputation: 538
Remove All Cookies
android.webkit.CookieManager.getInstance().removeAllCookie();
Remove Specific Cookies
CookieManager.getInstance().setCookie("twitter.com", "auth_token=''");
Upvotes: 0
Reputation: 239
Current method
TwitterCore.getInstance().getSessionManager().clearActiveSession();
Upvotes: 0
Reputation: 11175
@Rob answer is working, but this methods was removed in Twitter SDK v3.0.0
According to upgrading guide:
[Removed]
TwitterCore#logOut()
was removed useTwitterCore.getInstance().getSessionManager().clearActiveSession()
instead.
Upvotes: 5
Reputation: 748
In android application, if you are using Fabric and you want to logout from Twitter, try this:
Twitter.getInstance();
Twitter.logOut();
Upvotes: 3