PhoneGap Build - navigator.notification.confirm not working (method undefined)

belomat picture belomat · Oct 17, 2013 · Viewed 11.4k times · Source

I am developing an Android/iOS app with AngularJS and Phonegap Build, using Ripple Emulator in Chrome for local debugging.

navigator.notification.confirm is not working for me, while navigator.notification.alert, navigator.notification.beep and navigator.notification.vibrate are working fine. Chrome says: "Uncaught TypeError: Object [object Object] has no method 'confirm'", iOS Simulator just does nothing.

I have <gap:plugin name="org.apache.cordova.core.dialogs" /> and <preference name="phonegap-version" value="3.0.0" /> in my config.xml, and my index.js has the following in the deviceready callback:

navigator.notification.confirm("Yes or no?", function(){}, "Confirmation", "Yes,No");

Any ideas? Thanks.

Answer

MBillau picture MBillau · Oct 17, 2013

I just tried with a fresh install (Cordova 3.1.x) and it worked fine without any issues. I installed the plugin myself with cordova plugin add org.apache.cordova.dialogs, which is a bit different than using phonegap-build. I think this might be an issue with PGB but one suggestion I'll make is to change: <gap:plugin name="org.apache.cordova.core.dialogs" /> to <gap:plugin name="org.apache.cordova.dialogs" />, that is, remove the .core part, since core was removed from the namespace (might still be there for 3.0 though.)