Notifications
In a mobile application, on numerous occasions, we would want to notify the user of some action or collect some information from the user. In web applications, to achieve this functionality we make use of the JavaScript popup boxes—Alert Box, Confirm Box, and Prompt Box. If we make use of these default JavaScript alerts in our native application, it gives away the fact that your application is not native and gives the end-user a non-native feel. To avoid this, we make use of the notifications API in Cordova. The notification API has the following methods:
notification.alert
notification.confirm
notification.prompt
notification.beep
notification.vibrate
To access this feature, we need to add the notification plugin to our project. The following commands are to be fired on the Terminal, and these commands will make this plugin available to all targeted platforms:
$ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration.git $ cordova plugin add...