Introducing Actions: Push Messaging for an Interactive World

This week we shipped version 4.0 of our mobile SDK for iOS and Android. This new release brings several enhancements to the push messaging workflow, collectively called the Actions Framework. We're so incredibly excited about this new set of features, we just couldn't wait to share it with you. This blog post will cover the basics of actions from an app developer's perspective, so that you can start taking your app's messaging to the next level in no time.

So what's an action, anyway?

Have you ever received a push notification, tapped it on your device, and gotten dumped in the main screen of the app with no further context, asking "now what?" So have we, and it's a rather disappointing experience. Actions are an answer to that question.

Actions allow you to send customized notification payloads that cause interesting things to happen when a notification is received or activated. They're designed to help you connect what the app does in the end-user's hand, with what you send in the Push Composer.

When we talk about the Actions Framework in the abstract, we don't necessarily mean a mobile or server-side technology on its own, but rather a cooperation between the device and the messages sent to it. More specifically, the device needs to know how to perform tasks by name, with optional arguments, in certain distinct situations, with an optional result value.

Actions can be triggered either from incoming push payloads (in various app lifecycle states) or through user interaction in rich HTML content. In order to provide a consistent experience, we've established a convention for transmitting this information and for defining new, ad-hoc actions so that the framework can be extended to meet your application's needs.

What you get out of the box

Actions provide complimentary value to both developers and those in non-technical roles. For example, they provide for a convenient handling of your pre-existing deep link URLs, for responsive in-app navigation. Your counterparts in Product and Marketing can select these, or links to external apps and web pages from within the Push Composer, for a more relevant user experience.

With actions you can dynamically add or remove tags with ease, either when the notification is opened, or from user interaction in rich app pages. Even if you don't have a need for a full-blown message center, our SDK and API now support landing pages, which are ad-hoc rich HTML pages that can be launched from a push and require no app-integration to use.

Best of all, because these features are deeply integrated with our latest SDK, API, and Push Composer, your app gets all the above power-ups without a single added line of native code.

Let's continue with a more concrete example, so that we can see what it's like to use actions in practice.

A tale of many Goslings

Let's say you're the proprietor of a popular Ryan Gosling fan app. A classic engagement strategy would be to send the occasional push message, enticing users back into the app:

That's certainly hard to disagree with, but not very compelling on its own. To further incentivize engagement, we'll add a landing page - - a rich HTML window that displays as soon as the user opens the app by tapping the notification. In our JSON-based push API, that would look something like this:

Of course for non-developers, it's much easier to use our Push Composer on the Urban Airship dashboard site, which supports standard and customizable templates for creating rich content. In this case we can quickly create a new landing page based on the "Image" template, and fill out the requisite details:

After finishing our message and sending it off, opening the notification will drop the user into our landing page:

Alright, now we're getting somewhere. But clearly not all users prefer dog-oriented Goslings, and thus some of these pushes will go unopened. Wouldn't it be nice to allow users to segment themselves, so that you can custom tailor future pushes to a Ryan Gosling Petting Dogs vertical? By adding a button and an associated tag action to our landing page template, we can send a page that allows users to opt in to related content, by setting a "likes_dog_pictures" tag when the button is tapped:

When the user opens the notification, tapping the button labeled "Do it" will add the tag "likes_dog_pictures". Now whenever we want to send out new pictures, we can choose to address this customer segment independently.


This strategy works quite nicely for small sets of segments, but it's not entirely scalable to larger sets, since we'd need send a separate push for each, in order to get users to respond and tag themselves. Depending on the number of verticals, this could begin to put users off, and cause them to perceive these messages as spam. In this case, we could always augment our landing page with custom HTML to show a survey to the users, allowing them to select their favorite among multiple goslings and set a tag accordingly.

Since actions are made to be triggered from both notifications and rich HTML content, this is almost comically easy, even when writing custom markup. Simply add this JavaScript to your button's onClick handler:

The above JavaScript call runs the action responsible for adding tags, taking the action name, the argument (in this case a string) and a node-style callback function that passes optional error and result values. In this case we don't need the result value, as this particular action doesn't produce one, so we simply finish by calling the UAirship.close method, which dismisses the landing page.

At this point we've built an efficient means of pushing interactive pages to users that allows them to segment themselves, opting in to future, audience-tailored content. Not bad, for a day's work. But add some automation triggers into the mix and things start to get really interesting. Now your dynamic user segments are conditions that can automatically trigger future pushes. These future pushes can carry more interactive content, creating new segments, setting off new triggers...

A little imagination is a beautiful thing

Hopefully by now we've piqued your interest, but it's worth risking overstatement. Part of what we mean by the term "mobile maturity" is engaging your users in a two-way conversation, and actions are a powerful means of bridging that gap. There is much more to talk about than we have the space to go into here, but for a deeper dive, including details on how you can create your own actions, see our technical documentation:

  • Actions API and UI documentation 
  • Automation API and UI documentation

Do you have a fantastic idea of something you'd like to build with this framework? Drop us a line and share your dreams with us.