I have installed Notification plugin like this:
phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git
Then I have added to the config.xml
in /www/
folder:
<feature name="Notification">
<param name="android-package" value="org.apache.cordova.dialogs.Notification" />
</feature>
And I have tried to test the plugin like this in my index.html
:
document.addEventListener("deviceready", onDeviceReady, true);
function onDeviceReady() {
alert('Device ready');
var beep = function(){
try{
if(navigator != null){
navigator.notification.alert("2");
}else{
alert(navigator);
}
}catch(e){
alert("Alert failed: " + e.message);
}
}
beep();
}
But I always get "Alert failed" as the message that the navigator.notification
is undefined.
I am using phonegap 3.3.0-0.19.6
and I build the project with phonegap local build android
What am I missing?