Push notification
Push notification is the ability of a mobile device to receive messages that are pushed from a server. The most common form of notification is SMS (Short Message Service). Notifications are received regardless of whether the application is currently running.
Notifications can take several forms, and are platform-dependent:
- Alert: a pop-up text message
- Badge, Tile: a graphical representation that includes a short text or image
- Banner, Toast: a pop-up text message at the top of the device display that disappears after it has been read
- Audio alert
The MobileFirst unified push notification mechanism enables the sending of mobile notifications to mobile phones. Notifications are sent through the vendor infrastructure. For example, iPhone notifications are sent from the MobileFirst Server to specialized Apple servers, and from there to the relevant phones. The unified push notification mechanism in IBM MobileFirst Platform Foundation makes the entire process of communicating with the users and devices completely transparent to the developer.
Figure 1. Push notification mechanism
Push notification currently works for iOS, Android, and Windows Phone 8. iOS apps use the Apple Push Notification Service (APNS), Android apps use Google Cloud Messaging (GCM), and Windows Phone 8 apps use the authenticated and non-authenticated Microsoft Push Notification Service (MPNS). SMS push notifications are supported on iOS, Android, Windows Phone 8, Java ME, and BlackBerry devices that support SMS functions. For more information about setting up push notification for each platform, see Set up push notifications.
Proxy settings
Use the proxy settings to set the optional proxy through which notifications are sent to APNS and GCM. We can set the proxy using the push.apns.proxy.* and push.gcm.proxy.* configuration properties. See Application server-side configuration parameters.
Architecture
Unlike other IBM MobileFirst Platform Foundation services, the push server requires outbound connections to Apple, Google, and Microsoft servers using ports that are defined by these companies.
See Possible MobileFirst push notification architectures.
- Possible MobileFirst push notification architectures
IBM MobileFirst Platform Foundation supports two different methods of implementing push notifications, which are based on how the enterprise back end provides the messages to the MobileFirst Server.
- Set up push notifications
We can send push notifications to mobile devices via the MobileFirst Server. We can set up push notifications on Android, iOS, and Windows Phone 8.
- Broadcast notifications
Broadcast notifications are notification messages that are targeted to all the devices that have the MobileFirst application installed and configured for push notifications.
- Event source-based notifications
Before a device can start receiving push notifications, it must first subscribe to a push notification event source. When the user approves the push notification subscription, the device is registered with an appropriate push server.
- Interactive notifications
Interactive notifications allow the users to take actions when a notification is arrived without opening the application. When an interactive notification arrived, the device shows the action buttons along with the notification message. Currently, the interactive notifications are supported on iOS devices with version 8 onwards. If an interactive notification is sent to iOS devices with version lesser than 8, the notification actions are not displayed.
- Tag-based notifications
We create tags for an application by specifying tag details in application-descriptor.xml. Then use methods of the WL.Client.Push class to set up tag subscriptions and initiate tag-based notifications.
- Silent notifications
Silent notifications are notifications that do not display alerts or otherwise disturb the user. When a silent notification arrives, the application handing code runs in background without bringing the application to foreground. Currently, the silent notifications are supported on iOS devices with version 7 onwards. If the silent notification is sent to iOS devices with version lesser than 7, the notification is ignored if the application is running in background. If the application is running in the foreground, then the notification callback method is invoked.
- Web-based SMS subscription
Subscription, and unsubscription, to SMS notifications can be performed by making HTTP GET requests to the subscribe SMS servlet. The subscribe SMS servlet can be used for SMS subscriptions without the requirement for a user to have an app installed on their device.
- 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.
- Sending SMS push notifications
In addition to standard push notifications, we can also send Short Message Service (SMS) messages, more commonly known as text messages, to user devices. To receive SMS notifications, users must first subscribe to a push notification event source.
- Sending push notifications from WebSphere Application Server – IBM DB2
To issue push notifications from a WebSphere Application Server that uses IBM DB2 as its database, a custom property must be added.
- Configure a polling event source to send push notifications
Polling event sources can be used to generate notification events, such as push notifications, that the MobileFirst client framework can subscribe to.
- Use two-way SMS communication
SMS two-way communication enables communication between a mobile phone and the MobileFirst Server, over an SMS channel. SMS messages that originate from the mobile device can be sent to the MobileFirst Server through an external SMS gateway. The MobileFirst Server can then send a response message back to the originating mobile device.
- Use native and JavaScript push APIs in the same app
We can use Native and JavaScript push APIs in the same MobileFirst app.
- Troubleshooting push notification problems
Find information to help resolve push notification issues that you might encounter.
Parent topic: Develop MobileFirst applications