0
我正嘗試使用我的移動應用在twitter上發佈推文。 我已通過登錄鏈接到我的應用程序的Twitter頁面授權我的帳戶。titanium twitter未發佈
現在,當我發佈它給出了'未發佈'的警報。
有誰知道原因?
這裏是我的代碼:
submit.addEventListener('click', function(){
var oAuthAdapter = new OAuthAdapter('SECRET KEY', 'KEY', 'HMAC-SHA1');
// load the access token for the service (if previously saved)
oAuthAdapter.loadAccessToken('twitter');
oAuthAdapter.loadAccessToken('twitter');
oAuthAdapter.send('https://api.twitter.com/1/statuses/update.json', [['status', 'Test from appcelerator ' + Math.random()]], 'Twitter', 'Published.', 'Not published.');
if (oAuthAdapter.isAuthorized() == false) {
// this function will be called as soon as the application is authorized
var receivePin = function(){
// get the access token with the provided pin/oauth_verifier
oAuthAdapter.getAccessToken('https://api.twitter.com/oauth/access_token');
// save the access token
oAuthAdapter.saveAccessToken('twitter');
};
// show the authorization UI and call back the receive PIN function
oAuthAdapter.showAuthorizeUI('https://api.twitter.com/oauth/authorize?' +
oAuthAdapter.getRequestToken('https://api.twitter.com/oauth/request_token'), receivePin);
}
});
hm ..很難說。您的訪問令牌/祕密似乎是確定的,因爲您的錯誤發生在oauthadapter.send(..)。 – mkind 2011-03-11 12:24:12
你只需要加載訪問令牌一旦我想..但這不是重點。 – mkind 2011-03-11 12:24:38
你已經知道該頁面:http://ziodave.tumblr.com/post/746024933/titanium-implementation-of-twitter-oauth – mkind 2011-03-11 12:26:58