mactunes

rudy norff

Building Your Own APNS Fast and Easy

For a rather small project I recently had the need to send push notifications to iOS devices. I read the documents on Apple’s developer site, but after studying them briefly, decided it was not worth the effort to implement their proprietary protocol which is based on TCP sockets. So I started looking for alternatives and I came across two projects which I have tested.

The first project is Easy APNs. Easy APNs is based on PHP and requires you to have a MySQL database running on your server. The setup is straightforward, but it requires some setup time. I went with this solution for some time and it worked out really well. I never saw any problems with Easy APNs. Getting to use Easy APNs is, as its name implies, simple mainly due to its good documentation.

However, after some time I decided that I wasn’t too happy with having a PHP based solution anymore. As my project required a desktop machine running Java anyway I started looking for an alternate solution and came across it fairly quickly. java-apns is a simple library (JAR-file) which you can embed into your existing Java code. The method calls are simple, but you may need to handle invalid tokens and your current devices yourself. The library just takes care of all the communication with the Apple push notification server. Nothing more and nothing less. Embedding the JAR-file and tailoring my code to make use of it only took a couple of hours and I couldn’t be happier with the result.

I am not recommending one over the other here and I definitely don’t want to start another PHP vs. Java war in this post. It is simply a matter of taste and necessity, really. I can recommend both solutions as I have actually tried and used them for some time. If you are more into PHP or your project already uses that technology take Easy APNs. If you are more into Java or your servers are powered by that technology use the Java library instead.

java-apns Easy APNs

Powered by Octopress

Recently, I have been looking for a good blog solution and I think I have finally found one. I wasn’t too happy with Wordpress as it either requires a lot of set up on your server or if you host it with them lose some of the flexibility. I somehow also didn’t like Tumblr too much. For me it looks more like a trend than a good solution at the moment.

After some searching I found Octopress which is a solution that uses Github’s Jekyll and generates static HTML pages from so called markdown-files. I hope I understood that all correctly :) In the coming weeks I hope to fill this blog with some, hopefully, educating posts on everything iOS development.