Vera Reynolds

How the Tracker Team Uses Pivotal Push Notification Service

Productivity

Did that story you were waiting for get delivered? Did the project manager answer that question you asked? One of the cool things about having Tracker on your phone is the ability to get notifications about your projects on the go. Please welcome push notifications for Tracker Android, and improved notifications for Tracker iOS!

When it was time to introduce notifications to the newly re-engineered Android app, we evaluated our options. There were a number of issues with the existing iOS app notification system, most notably around device token management. We were looking for a solution that would allow us to deliver messages to both iOS and Android platforms in a streamlined way, would scale to meet demand, and which would be easy to maintain in the future. We decided to use Pivotal Push Notification Service (PNS) for Pivotal Cloud Foundry, a multi-platform tool for delivering notifications:

The Pivotal Push Notification Service flow.

The first step was installing PNS in our PCF space. If you’re lucky enough to have friends in the PCF operations department, they can do this part for you; otherwise there’s an installation guide. Once the service was available, we configured its connection to Google FCM and Apple Push Notification Service using the appropriate service key and certificate. At this point, we were ready to try registering a device.

Using the Registration API, we successfully registered a device with PNS, at which point it appeared in the device list in PNS dashboard:

Registering a device with PNS.

Although we hadn’t yet done any configuration to send notification from the Tracker server, we were able to verify that the device ⇆ PNS part of the system was working by sending a simple test notification through the dashboard above.

Of course we couldn’t stop there. It was time to send a more realistic notification. Since we already had an existing path in place for sending iOS notifications from the server, we simply added a POST request to the Push API with the desired notification payload. At this point, we were able to test the system end to end (device ⇆ PNS ⇆ server).

That one Success meme with the toddler making a fist.

We also handled incoming messages in the apps. While you can send a simple text notification which does not require this step, we wanted our push notifications to have a bit more flair. To accomplish that, we utilized the platform-specific custom messages, which allowed us to define the desired notification behavior, such as styling, grouping, and tapping.

Another thing to note is that we used custom user IDs to register devices and target audiences in PNS. This tactic allowed our server to remain blissfully unaware of device UUIDs and tokens, relying instead on a domain specific identifier for notification recipients.

While we did utilize the core features of PNS, other interesting possibilities remain unexplored. We could have more fine-grained audience targeting, for example only notifying iOS or Android users. Topics are another way to section your recipients, by allowing people to subscribe to topics they want to get notifications on. We could schedule notifications to go out at certain times or when devices enter a certain location. Overall, our experience using PNS has been a successful one, and we’re excited to see its evolution as it is being actively developed.

As always, we welcome your feedback and would love to know how we can continue to improve your Tracker mobile experience. Please contact us on Twitter or email us with any input.

Category:

Tags: