Twitter: Failed to get request token

2019-01-27 06:41发布

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();
        }
    });

1条回答
再贱就再见
2楼-- · 2019-01-27 07:20

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.

查看更多
登录 后发表回答