+

Search Tips   |   Advanced Search

Sending push notifications

When we have set up push notification, whether event-source based, tag-based, or broadcast-enabled, we can send push notifications from the server.


Event source-based notification

To start receiving push notifications, an application must first subscribe to an event source. The event source is a push notification channel to which mobile applications can register. An event source is defined within a MobileFirst adapter.

User must approve receiving push notification messages before the device can start receiving push notifications. When the user approves, the device registers with an Apple, Google, or Microsoft push server to obtain a device token used to identify the device. This operation takes place automatically within IBM MobileFirst Platform Foundation.

The unified push notifications API comprises two elements:

For more information about the API, see WL.Server.

The process is as follows:

  1. A notification is retrieved from the back-end system. Notifications can be polled from the back-end system, or the back-end system can explicitly push a new notification.

  2. The notification is retrieved by the adapter, processed, and then sent through the corresponding push service mediator (Apple, Google, or Microsoft). For more information about setting up push notifications, see Set up push notifications.

  3. The push service mediator receives the notification and sends it to a device.

  4. The device processes the received notification.


Tag-based notification

Before we can send tag-based notifications, we must set up tag subscriptions. See Tag-based notifications.

We can send a tag-based notification in the following way:


Broadcast notification

Before we can send a broadcast notification, we must set up broadcast notifications for the required applications. See Broadcast notifications.

We can send a broadcast notification in the following way:


Unicast notification

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 configuring the application for push notifications, see Set up push notifications.

We can send a unicast notification to a particular device in the following way:

We can send a unicast notification to a particular user in the following way:

The notification message can target multiple devices or users by specifying multiple deviceIDs or userIDs in the notificationOptions.tager.deviceIds or notificationOptions.target.userIds.


Platform or environment-based notification

We can send a platform or environment-based notification in the following way:


Restriction

Restriction: The sendMessage method does not support SMS notification. See Sending SMS push notifications.


Parent topic: Push notification