I’m using Phonegap (Cordova) v1.9, and this app is solely for iPhone4+ use.
I’ve tried the two methods below, on their own and simultaneously.
Phonegap’s deviceready event has been fired previous to this code.
I’m using the iPhone configuration utility to watch the console, but I’m not getting anything from the code below.
Also, I’m using Sencha Touch (v1.1) and jQuery. No conflicts noticed throughout the app.
Please help?
function onConfirmCallback(button){
console.log("onConfirmCallback");
console.log(button);
}
var toConfirm = navigator.notification.confirm("You don't have a pincode set.\nWould you like to set one now?", onConfirmCallback, "Pincode", "Yes,No");
toConfirm.onAlertDismissed = function(index, label){
console.log("onAlertDismissed");
console.log(index);
}
Have you tried looking for exceptions to see what might be happening?
Edit:
The example mentioned in the comment below (from https://groups.google.com/group/phonegap/browse_thread/thread/126f56f4e296e555) is for PhoneGap 0.9.2. I have not seen any examples for v1.3 where the confirm function returns an object as your using with ‘toConfirm’. Maybe that is causing your problem. Have you tried the following (removing all other code to do with
toConfirmto simplify the problem)?http://docs.phonegap.com/en/1.3.0/phonegap_notification_notification.md.html#notification.confirm
Also, is there any reason your not using a newer version of PhoneGap (Cordova)?