Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
936 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...