I am working on Twitter integration with my Android app.
Let's imagine a scenario:
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.
You can check verify the credentials by calling GET account/verify_credentials
, which would tell you information about the token's integrity. Here is the API note on it.