I am working on Twitter integration with my Android app.
Let's imagine a scenario:
- User have authorized my app.
- I have got access token and saved it (along with token secret) to SharedPreferences.
- User opens his Twitter account and kicks out my app.
Obviously, access token becomes invalid at step 3. And attempt to post on behalf of the user results in TwitterException
saying "Received authentication challenge is null".
I guess I have to start authorization process again, but how do I know that the saved access token has become invalid?
I think I can analyze TwitterException
, but what method specifically? TwitterException
has a lot of undocumented methods like getExceptionCode()
, getStatusCode()
, getErrorCode()
and I have no idea which to use to found that my access token has been invalidated.