0

I am working on Twitter integration with my Android app.

Let's imagine a scenario:

  1. User have authorized my app.
  2. I have got access token and saved it (along with token secret) to SharedPreferences.
  3. 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.

4

1 回答 1

1

您可以通过调用来检查验证凭据GET account/verify_credentials,这将告诉您有关令牌完整性的信息。这是关于它的API 说明

于 2013-10-29T14:54:31.093 回答