Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

android - Twitter: Failed to get request token

I am using Log In with Twitter for my Android app, that was successfully loging in for the past few days. Now the login fails

Twitter Log In:

 mTwitterLoginButton = (TwitterLoginButton) findViewById(R.id.twitter_login_button);
    mTwitterLoginButton.setCallback(new Callback<TwitterSession>() {
        @Override
        public void success(Result<TwitterSession> result) {
            Intent i = new Intent(getBaseContext(), FeedActivity.class);
            i.putExtra("Socials", "Twitter");
            i.putExtra("Twitter AuthToken", result.data.getAuthToken().token);
            i.putExtra("Twitter AuthSecret", result.data.getAuthToken().secret);
            i.putExtra("Twitter UserName", result.data.getUserName());
            i.putExtra("Twitter UserID", result.data.getUserId());
            startActivity(i);
        }

        @Override
        public void failure(TwitterException exception) {
            new SnackBar.Builder(mActivity)
                    .withMessage("Twitter Login Failed.")
                    .withBackgroundColorId(R.color.tw__blue_pressed)
                    .show();
            exception.printStackTrace();
        }
    });
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I was seing this same issue today, and I didn't have any code changes. Twitter just suddenly stopped authorizing and told me it couldn't get request token.

I just had to restart my emulator and it started working again.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...