【发布时间】:2014-08-11 23:44:07
【问题描述】:
在我的 android 应用程序中,我需要添加 twitter 登录功能。我在应用程序中集成了代码,但在返回时找不到异常 ssl。 我的登录代码是 -
if (!isTwitterLoggedInAlready()) {
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.setOAuthConsumerKey(TWITTER_CONSUMER_KEY);
builder.setOAuthConsumerSecret(TWITTER_CONSUMER_SECRET);
Configuration configuration = builder.build();
TwitterFactory factory = new TwitterFactory(configuration);
twitter = factory.getInstance();
try {
requestToken = twitter
.getOAuthRequestToken(TWITTER_CALLBACK_URL);
this.startActivity(new Intent(Intent.ACTION_VIEW, Uri
.parse(requestToken.getAuthenticationURL())));
} catch (TwitterException e) {
e.printStackTrace();
}
} else {
// user already logged into twitter
Toast.makeText(getApplicationContext(),
"Already Logged into twitter", Toast.LENGTH_LONG).show();
}
它返回的错误是 -
403:The request is understood, but it has been refused. An accompanying error message will explain why. This code is used when requests are being denied due to update limits (https://support.twitter.com/articles/15364-about-twitter-limits-update-api-dm- -following).
需要 SSL
相关讨论可以在 Internet 上找到:
http://www.google.co.jp/search?q=10f5ada3 或
http://www.google.co.jp/search?q=dceba039
TwitterException{exceptionCode=[10f5ada3 dceba039], statusCode=403, retryAfter=-1, rateLimitStatus=null, featureSpecificRateLimitStatus=null, version=2.2.6}
空
SSL is required
空
异常诊断{stackLineHash=284536227, lineNumberHash=-588537799}
我不知道错误是什么。
还有一个问题是app中使用了什么回调url。
提前致谢。
【问题讨论】:
标签: android twitter-oauth twitter4j