iPhone Push and My First App
I’m working on my first (useful) iPhone app. It’s a push mechanism for Twitter updates and functions similarly to the Polar Bear Farm Tweet Push updater app ($0.99/30 days). Their app pushes all friend updates, which is quite a bit too much. Instead, mine is set to only push those tweets with users marked for notifications. That’s an option not available in any of the push notification Twitter apps that I’ve seen so far. This is to save on the outrageous SMS costs on which I still refuse to subscribe to any more than the base plan on. Twitter can eat that like candy if I want alerts. I may opt to allow ad-hoc distribution to friends’ iPhones, we’ll see. Until then, my server’s hard drive seems to have crashed so service quality is a bit low!
As far as thoughts about my experience with developing the app, I followed a recipe that I had seen in an article on Ars Technica before the 3.0 SDK was public. Overall it was very easy to write the skeleton push app and have it launch Twitterific once it loads, but the notifications certificates and other required handshakes were fairly hard to navigate. After all that’s done, all I had to do was make a daemon to check Twitter and push it over Apple’s network. For this, I used Python Twitter Tools to great success.
I did run into one fairly odd problem. It turns out that Twitter’s API doesn’t actually match up to what I’m fairly sure it’s supposed to be at the moment. Requesting a user’s friends status list (statuses/friends, max 100 at a time) seems to correctly report which users are set with device notification turned on. However, the friends timeline (statuses/friends_timeline) function that returns the last X number of tweets has a user tag in it for each update. This user tag doesn’t show the same value for notifications that the friend list does. That’s a problem since my app is suited to using the friends_timeline to get the last few updates to push out, but can’t use the notifications without spending another API call per 100 friends a user has. A bug report has been submitted to the API folks. For now, I can manually filter the users out without using Twitter’s data, but if I were to let anybody else use the app, I’d really prefer it to work correctly.
