我想在android應用上發佈推文。我在adroid中創建應用程序,並給予權限讀取和寫入。 我得到令牌和消費者密鑰, 而我寫這篇文章的代碼:如何在android應用中發佈推文?
String token ="<Your access token>";
String secret = "<Your access token secret>";
AccessToken a = new AccessToken(token,secret);
Twitter twitter = new TwitterFactory().getInstance();
twitter.setOAuthConsumer("<Your consumer key>", "<Your consumer secret>");
twitter.setOAuthAccessToken(a);
try {
twitter.updateStatus("android test");
} catch (TwitterException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
但它給錯誤:
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-and-following).
Relevant discussions can be on the Internet at:
http://www.google.co.jp/search?q=b2b52c28
or
http://www.google.co.jp/search?q=1b442886
TwitterException{exceptionCode=[b2b52c28-1b442886], statusCode=403, retryAfter=-1, rateLimitStatus=null, featureSpecificRateLimitStatus=null, version=2.2.5}
我怎樣才能解決這個問題?
初步答案是顯而易見的:你碰到的錯誤消息(微博數等)引用了限制。所以我想真正的問題是,如果你意外得到了這個信息(例如發送當天的第一條推文)。 – epx
我ddid沒有發佈在過去爲什麼你認爲我碰到了極限? – user3086226