title: Cordova dialogs plugin: cannot read property alert
body: <p>I have been trying to use the cordova dialogs plugin on a hybrid phone app, on android. It kept returning the same error:<br>
  Uncaught TypeError: Cannot read property 'alert' of undefined</p>
  
  <p>Therefore I stripped the app down to the bare minimum. In my cordova directory, I have one super simple html file, that starts up the javascript file.</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
         &lt;script src="js/script.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Then, in that script.js file, I have copied and pasted the exact example code from the cordova API and cordova dialogs plugin API.<br>
  <a href="https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-dialogs/" rel="nofollow noreferrer">https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-dialogs/</a></p>
  
  <pre><code>  function onLoad() {
      document.addEventListener("deviceready", onDeviceReady, false);
    }
    function onDeviceReady() {
      console.log(navigator.notification);
    }
    function alertDismissed() {
      // do something
    }
  
    navigator.notification.alert(
        'You are the winner!',  // message
        alertDismissed,         // callback
        'Game Over',            // title
        'Done'                  // buttonName
    );
  </code></pre>
  
  <p>I then run the app on my android phone in terminal with cordova run, the app builds and launches without issue. But I do not get an alert. When I inspect the app, it again gives me the same uncaught type error. </p>
  
  <p>Does anyone have an idea on why this won't work?</p>
  
  <p>I'm running it on<br>
  OSX 10.12.3<br>
  Cordova v 6.5.0<br>
  Android command line tools installed, with jdk 25.2.5  </p>
  
  <p>Also, the plugin is installed in the cordova directory and I can see it in the plugin folder.</p>