Overview

Skill Level: Any

Prerequisites

Not what you’re looking for? Check out all our available tutorials for mobile app messaging here.

Step-by-step

  1. Create your silent notification through the Watson Campaign Automation user interface.

    Select the Data type notification. If you use the Sample Data template, you get a notification that looks like

    Bundle[{data={“sample type”:{“title”:”Welcome to NYC”}}, from=(your Google ID), android.support.content.wakelockid=1, collapse_key=do_not_collapse}
    

    in your onMessage: method.

    Tip: This is similar to creating a silent notification for iOS by using the Sample Data template. Other templates will look the way you define them.

  2. Use the Push to Contact or Push to Device APIs.

    You can create a notification with any content you specify; however, make sure not to have the alert element in the notification. The Sample Data template leaves out the alert element; this is why it triggers a silent push.

Expected outcome

Every time a notification with no alert element is sent, no notification is displayed. In the app, you must override or modify the onMessage: method to take the action that you want when the silent notification is received.

Need more help? Check out all of our available tutorials for mobile app messaging here.

Join The Discussion

Your email address will not be published. Required fields are marked *