Here Comes Grails APNs Plugin
That’s it. I’ve released my first Grails plugin ever. Woooo! Champagne!
If you follow my Twitter feed, you’ve probably noticed that I’ve been playing a lot with Apple Push Notification service lately (APNs for friends). Indeed, ConferenceGuide still requires a data connection, which can be problematic on a lot of events because they’re usually abroad (and roaming fees are waaaaaay too expensive), and even when you do have a data connection, it’s usually pretty slow… at best. That’s probably why one of the most requested features for ConferenceGuide is Offline Mode.
But getting all the data directly from the server does have at least one advantage: you’re always up-to-date. And experience has shown that sh** happens: sometimes sessions are cancelled at the last minute, or a global sound mixer reboots out of nowhere, thus shifting all sessions by 15 minutes. Those of you who were at Devoxx last November know what I’m talking about. So I needed a way to combine the best of both worlds: being able to browse schedule and speaker information without a data connection, and still get updates whenever something changes and I can find a wifi hotspot or something.
The first part of the solution is the local database. The second part involves sending push notifications. The problem with the latter is that the API provided by Apple is pretty low-level and the documentation is rather scarce. And it’s understandable because they expose a service that should be usable by any server technology, whether it is Java, .Net, PHP, Rails, etc. Fortunately, Java has a huge community and a great Open Source spirit, so it wasn’t long before a few projects were created to build an abstraction layer on top of APNs API. The simplest and most documented one I found is java-apns by Mahmood Ali. But ConferenceGuide server is not plain Java. It’s Grails 1.1 (I haven’t taken the risk to migrate to 1.2 yet). So I wanted to ease the integration of java-apns into any Grails application. And voilà! Grails APNs Plugin.
Special thanks to Burt Beckwith for helping me get started, and Mahmood Ali for developing java-apns!