Open segolas-zoso opened 9 years ago
alarmDate should be a javascript Date object.
You can fix the code this way.
var alarmDate = new Date().getTime();
alarmDate = alarmDate + 2000; // milliseconds
navigator.plugins.alarm.set(new Date(alarmDate),
function(){
// SUCCESS
console.log("alarm triggered at "+alarmDate);
},
function(){
// ERROR
console.log("Error triggering the alarm "+alarmDate);
});
Hi,
I can't get this to work.
Here is my code:
On the android logcat I've got the error in the subject or, if I grep for "Web Console" I have the "Error triggering the alarm" message.
any idea what's wrong with my code? Looks pretty straightforward to me