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 books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.