21. Notification

The PhoneGap Notification API provides methods that allow an application to provide feedback to a user visually (through pop-up alerts) and through tactile or audible feedback. The methods supported by this API are as follows:

notification.alert

notification.confirm

notification.beep

notification.vibrate

Visual Alerts (Alert and Confirm)

The alert and confirm methods are each essentially extended versions of the standard JavaScript alert function. The JavaScript alert method, which works just fine in PhoneGap applications, takes a single parameter, which is the text of the message displayed on the screen, as shown in the following example:

alert("You clicked the Click Me button.");

This code generates the pop-up dialog ...

Get PhoneGap Essentials: Building Cross-Platform Mobile Apps now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.