Push Notifications Overview

Overview

IBM MobileFirst Platform Foundation provides a unified set of API methods to send notifications to devices on which MobileFirst applications are installed. Notification can be sent in 2 different ways: based on sources of events or based on tags.

Application ID

Subscription

To start receiving push notifications, an application must first subscribe to a push notification event source.
An event source is declared in the MobileFirst adapter that is used by the application for push notification services.

The end user must approve the push notification subscription.
After the subscription is approved, the device registers with an Apple, Google, or Microsoft push server to obtain a token that is used to identify the device (“Allow notifications for application X on device Y”), and sends a subscription request to the MobileFirst Server. This operation is performed automatically by the MobileFirst framework.

Demonstration

When the subscribe API method is called, the device registers with a push service mediator and obtains a device token (done automatically by the framework).

When the token is obtained, the application subscribes to an event source. Both actions are done automatically by a single API method call, as described in Subscription management.

Before a notification can be sent, it must first be retrieved from the back end.

An event source can either poll notifications from the back-end system, or wait for the back-end system to explicitly push a new notification.
When a notification is retrieved by the adapter, it is processed and sent through the corresponding push service mediator (Apple, Google, or Microsoft).

Some custom logic can be added in the adapter to preprocess notifications. The push service mediator receives the notification and sends it to a device.

Demonstration

Notifications are retrieved by the MobileFirst adapter event source, either by poll or by push from the back-end system.

The adapter processes the notification and sends it to a push service mediator.

The push service mediator sends a push notification to the device.

The device processes the received notification.

Subscription management

User subscription

Subscription

An entity that contains a user ID, a device ID, and an event source ID. It represents the intent of the user to receive notification from a specific event source.

Creation

The user subscription for an event source is created when the user first subscribes to the event source from any device.

Deletion

A user subscription is deleted when the user unsubscribes from the event source from all the user’s devices.

Notification

While the user subscription exists, the MobileFirst Server can produce push notifications for the subscribed user. These notifications can be delivered by the adapter code to all or some of the devices that the user subscribed from.

Device subscription

A device subscription belongs to a user subscription and exists in the scope of a specific user and event source. A user subscription can have several device subscriptions.

The device subscription is created when the application on a device calls the subscribe method.
The device subscription is deleted either by an application that calls the unsubscribe method or when the push mediator informs the MobileFirst Server that the device is permanently not accessible.

Tag notifications

Tag push notifications are notification messages that are targeted to all the devices that are subscribed to a particular tag.

Broadcast notifications

Broadcast push notifications are a form of tag push notifications that are targeted to all subscribed devices.

Unicast notifications

Unicast notifications are targeted to a particular device or a userID. Unicast notifications do not require any additional setup and are enabled by default when the MobileFirst application is enabled for push notifications.

For more information about unicast notifications, see the topic about sending push notifications, in the user documentation.

Interactive notifications

iOS 8 and above only
Interactive push notifications enables action buttons to be added for received notifications.

Silent notifications

iOS 7 and above only
Silent push notifications enables notifications to be sent without disturbing the user.

REST API for Push notifications

MobileFirst Platform Foundation exposes a REST API endpoint that can be accessed by non-mobile clients. It is another way to use the push service without needing to develop and deploy MobileFirst adapters.

For more information about the REST API for push notification, see the topic about REST API Runtime Services, in the user documentation.