New Server Libraries Released — Python, PHP, and Java

With the release of API v3 we're offering a lot of power to developers working with our push notification system. As part of our goal to make integrations easier and more successful, we've built some server-side libraries for our API.

Python

We've had a Python library for some time, but it's been maintained as a side project by myself. As part of preparing for the API V3 release we reorganized the codebase. The existing v1 push and rich push functionality was maintained with a DeprecationWarning, and new functionality was added to support adhoc segmentation features. In addition we upgraded the HTTP transport to use requests, adding automatic reuse of HTTP keep-alives.

The audience and notification payload creation is handled with a series of functions in the urbanairship.push subpackages, and exposed via the top level package. There is a full set of audience and notification helpers to build out push requests, but it's easy to drop down to creating dictionaries and lists directly. Here's an example of sending a push to a tag, with different 'extra' data on iOS and Android:

PHP

Similarly to Python, we had a small PHP library in the past, but it was more of an example than a reusable component. For the API v3 release, the PHP library has been totally re-written to make use of modern PHP application development tools like Composer. Here's the same example above, using the PHP library:

The current release is 0.1, and should be considered a beta release. We welcome feedback on the style, structure, and whether it fits your needs. Check out the PHP library documentation, and the code on GitHub.

Java

Last but certainly not least, we've added a Java library. Since the Java library is totally new, we've started with the capability of sending segmented notifications and rich app pages. Here is an example of using the Java library:

Feedback and Contributions

We'd love to hear what you think of these libraries, and what features you'd like added next; just send us a note at support@urbanairship.com.

If you have bug fixes or new additions, we'd love to bring them in. To make things easier we've updated our Contribution License Agreement to be simpler and easier to understand; just fill that out and post a pull request on GitHub.