Push Notifications 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.
- What is push notification?
- Push notification types
- REST API for Push notifications
- Supported environments
What is push notification?
Push notifications is the ability of a mobile device to receive messages that are "pushed" from a server.
Notifications are received regardless of whether the application is currently running.
Notifications can take several forms:
- Alert (all): a pop-up text message
- Badge (iOS), Tile (W8, WP8): a graphical representation that allows a short text or image
- Banner (iOS), Toast (W8, WP8): a disappearing pop-up text message at the top of the device display
- Sound (all): a sound file playing when a notification is received
- Interactive (iOS 8): action buttons inside the Banner of a received notification
Push notifications are supported for the following mobile platforms:
- Android 2.3.5, 4.x, 5.x
- iOS 6, 7, and 8
- Windows Phone 8.x
- Windows 8
Push notification types
Event Source notifications
Event source push notifications are notification messages that are targeted to devices with a user subscription.
A push notification channel to which mobile applications can register. An event source is defined within a MobileFirst adapter.
A unique identifier, obtained from the push mediator (Apple, Google, or Microsoft), which identifies the request of a specific mobile device to receive notifications from the MobileFirst Server.
A unique identifier for a user. Obtained through authentication or other unique identifier such as a persistent cookie.
MobileFirst application ID. Identifies a specific MobileFirst application on the mobile market.
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.
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.
IBM MobileFirst Platform Foundation provides a unified API for push notification.
Use the adapter API for the following actions:
- Managing subscriptions
- Pushing and polling notifications from a back end
- Sending push notifications to devices
Use the application API for the following actions:
- Subscribing to and unsubscribing from push-notification event sources
- Handling incoming notifications
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.
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.
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.
The user subscription for an event source is created when the user first subscribes to the event source from any device.
A user subscription is deleted when the user unsubscribes from the event source from all the user’s devices.
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.
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 push notifications are notification messages that are targeted to all the devices that are subscribed to a particular tag.
Broadcast push notifications are a form of tag push notifications that are targeted to all subscribed devices.
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.
iOS 8 and above only
Interactive push notifications enables action buttons to be added for received 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.
- Push Notifications in Hybrid Applications
- Push Notifications in Native Android Applications
- Push Notifications in Native iOS Applications
- Push Notifications in Native Windows 8 Universal Applications
- Push Notifications in Native Windows Phone 8 Applications
Inclusive terminology note: The Mobile First Platform team is making changes to support the IBM® initiative to replace racially biased and other discriminatory language in our code and content with more inclusive language. While IBM values the use of inclusive language, terms that are outside of IBM's direct influence are sometimes required for the sake of maintaining user understanding. As other industry leaders join IBM in embracing the use of inclusive language, IBM will continue to update the documentation to reflect those changes.