This page aims to list out all of the various notification methods on each platform. It is an attempt to compose an exhaustive list of all possible "modalities" available for notifications across all platforms. It is not a list of notification implementations on PhoneGap, rather, a page to map everything out and to see if there is opportunity for a standard.
One thing we want to stay away from is giving access to native dialog/notification methods that can be reproduced within your app using HTML, CSS and JS.
Push Notifications
The Technology:
Internet-based communication where the request for a given transaction is initiated by the publisher (or central server). Contrasted by pull technology, where the information request is initiated by the receiver (or client).
General Use:
Often based on information preferences expressed in advanceā¦the publish/subscribe model.
-- from wikipedia, "Push technology" http://en.wikipedia.org/wiki/Push_technology
Platform Specific Details
iOS
Very basic details about the apple push notification service (APNs): http://support.apple.com/kb/HT3576
Local and Push Notification Programming guide: http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG
Note, push notifications are also know as remote notifications in iOS land, indicating that the data or message is originated from a remote location, as opposed to the OS on the device itself (which are local notifications).
Types of remote notifications:
- Sounds
- Alerts
- Home screen badges
See http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/MobileHIG/TechnologyUsage/TechnologyUsage.html > Local and Push Notifications section, for examples of the different types of notifications.
See http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW8 for UI guidelines on when to use and how to design notifications.
Android
A summary of different approaches is available on the Android Developer site. A few things to note:
- The dialog notifications can be built within a PhoneGap app using HTML, CSS and JS.
- Toast and Status Bar notifications are Android-specific.
Types of notifications:
Notification class is the entry point for creating various alerts. Can build notifications including any combination of light(s), sound and vibration. Also provides various interaction options on built notifications such as:
- Cancellable by user.
- Whether the notification represents a running Android service.
-
Whether the notification represents a high-priority event ("that may be shown to the user even if notifications are otherwise unavailable (that is, when the status bar is hidden).")
-
If it is insistent, which means the audio portion of the notification is persistent until explicitly cancelled by the user.
-
Whether it is unclearable by the user with a click or touch event.
-
Whether the notification is for an ongoing event, such as a phone call.
-
Whether the notification should play the sound and/or vibration each time the notification is sent, even if it has not been previously acknowledged by the user.
-
Whether the notification should light the LED of the device.
BlackBerry
The BlackBerry JDE has a NoticationsManager class which is used to register device notification profiles.
- Notification profiles are configured by the device end user, who chooses whether the profile plays sounds, vibrates, etc.
- The developer can register a source with the NotificationsManager, and trigger events for a given source, using the source's unique ID.
- PhoneGap BlackBerry WebWorks already makes use of the NotificationsManager class to register a source for each application. This means a notification profile will be created for each PhoneGap application on the device.
- The NotificationsManager does not provide an API to enable developers to change the notification profiles programmatically. The profile settings are at the complete discretion of the end user.
webOS
WebOS supports two different kinds of notifications:
- Banners: Temporary one-line popups that appear at the bottom of the screen, and disappear after a few moments. If the user taps on a banner, the application which created it is launched/relaunched, optionally with arguments.
- Dashboards: TODO
Banners can be created via the window.PalmSystem.addBannerMessage() method.
window.PalmSystem.addBannerMessage(bannerText, launchArgs, bannerIcon, soundClass, soundFile, soundDuration);
- @param {string} bannerText Text to display in the banner
- @param {string} launchArgs A JSON string of arguments passed to the application on re/launch. OPTIONAL
- @param {string} bannerIcon Path to an icon to show with the banner. OPTIONAL
- @param {string} soundClass The sound class to use. Supported classes include "ringtones", "alerts", "alarm", "calendar", "notification". OPTIONAL
- @param {string} soundFile Path to a sound to play with the banner. OPTIONAL
- @param {number} soundDuration duration to play sound, in ms. OPTIONAL
Dashboards
TODO
Windows Phone
The following types of notifications are available to Windows Phone:
- Toast: A push notification displayed at the top of the screen for 10 seconds or until dismissal by the user.
- Raw: A push notification similar to Toast but requiring user interaction.
- Tile: Used to update the application or secondary tile associated with the application. ("Tiles Overview for Windows Phone" - http://msdn.microsoft.com/en-us/library/hh202948(v=vs.92).aspx)
For more information see "Push Notifications Overview for Windows Phone" - http://msdn.microsoft.com/en-us/library/ff402558(v=vs.92).aspx
Notifications without push are available via the ShellToast and ShellTile classes within the Microsoft.Phone.Shell namespace and dialogs can be displayed via the MessageBox class.