Appcelerator Titanium Twitter Birdhouse Failing because of HTTP

Hold on Cowboy

This blog post is pretty old. Be careful with the information you find in here. It's likely dead, dying, or wildly inaccurate.

This problem caused me much angst and it’s partly Twitter’s fault (just ask me).

I’m using the great Titanium library for Twitter called Birdhouse. It does a great job requesting authorization, storing it, and gives you an API to post tweets. So I was using this code to post tweets using Birdhouse.

this.tweet = function(message) {'Im about to post to twitter:');;
  BH.api('', 'POST', 'status=' + escape(message), function(resp) {;
    if (resp !== false) {'Twitter Post Successful');
      if (typeof(callback) == 'function') {
      return true;
    } else {'Posting to twitter failed:');
      if (typeof(callback) == 'function') {
      return false;
  }, true);

The problem with this code is that it would only work sporadically. It drove me crazy thinking maybe the access token was not getting set. Then I printed out the error from twitter and it went like this

You know what the problem was? I was** using HTTP instead of HTTPS**. It was working sometimes, but not others, and it would be sporadic.

Resources Defunct URL


Did this help you out? It took me a few days to piece together all this information together, I hope this saves you some time (who knows, maybe the future me will be thankful I wrote this down). Let me know your thoughts. [email protected]