PhoneGap Build - navigator.notification.alert not working in WP7 emulator

753 views Asked by At

I build this simple code with PGB, but it does not working in WP7 emulator - no alert message. For android emulator its ok. What's wrong?

    document.addEventListener("deviceready", onDeviceReady, false);
    function onDeviceReady() {
        navigator.notification.alert("Device Ready!");
    }

Source code https://github.com/dprotopopov/pgb-wp7-alert

1

There are 1 answers

2
Oliver Gray On

This seems to be a bug with the latest PhoneGap build for WP7. I have this up and running in Visual Studio and although the navigator object is accessible in the code there is no notification property available. You can test the same yourself by iterating through the properties of the navigator object in your app;

for(var key in navigator){
   document.write(key + "<br>");
}

The list I get is as follows, note that notification is not one of them :(

  • appCodeName
  • appMinorVersion
  • browserLanguage
  • cookieEnabled
  • cpuClass
  • mimeTypes
  • plugins
  • systemLanguage
  • userLanguage
  • msDoNotTrack
  • geolocation
  • appName
  • appVersion
  • platform
  • userAgent
  • onLine
  • javaEnabled
  • taintEnabled