Sanoj Kashyap
Sanoj Kashyap

Reputation: 5060

Twitter message post in Titanium

I got some code by doing search which is doing a lot for me in showing the my tweets in tableview,till now fine. I want to add one more functionality to it that user can post the message from the sameapp.

So I just modified the code as per. While I hit the request I got result status as successful but message is not posting to my wall. I have all keys and getting access token as well.

 var client = Twitter({
      consumerKey: "have Key ",
      consumerSecret: "have Key",
      accessTokenKey: accessTokenKey, 
      accessTokenSecret: accessTokenSecret
    });


client.request("1/statuses/update.json", {status:'TEST'}, 'GET', function(e) {
              if (e.success) {alert(e.success);

          } else  {
            alert(e.error);
          }

Updated: I have go through the Twitter Dev API This is the URL http://api.twitter.com/1/statuses/update.format with required parameter "status". What am I doing wrong?

Upvotes: 0

Views: 1161

Answers (2)

Bilal
Bilal

Reputation: 26

You are sending GET request to update status whereas twitter api needs it to be a POST request.

Try something like

client.request( "1/statuses/update.json", {status:'TEST'}, 'POST', function(e) {
          if (e.success)
          {
             alert(e.success);
          } else  {
             alert(e.error);
          }

Upvotes: 1

Martin
Martin

Reputation: 1914

Check out this application: https://github.com/appcelerator-titans/tweetanium

From what I understand this is a fully working example of a twitter app created using Titanium Mobile. Perhaps you can follow the logic in here and see where you need to adjust.

Upvotes: 0

Related Questions