Commit c00e6cdf by Sebastián Katzer

Make sure that - if an ID is given - the ID needs to be a string.

The app crashes if a number is passed as an argument.
parent 311c1270
......@@ -40,6 +40,10 @@ LocalNotification.prototype = {
}
}
if (defaults.id) {
defaults.id = defaults.id.toString();
}
if (typeof defaults.date == 'object') {
defaults.date = Math.round(defaults.date.getTime()/1000);
}
......@@ -55,7 +59,7 @@ LocalNotification.prototype = {
* @param {String} id
*/
cancel: function (id) {
cordova.exec(null, null, 'LocalNotification', 'cancel', [id]);
cordova.exec(null, null, 'LocalNotification', 'cancel', [id.toString()]);
},
/**
......@@ -68,4 +72,4 @@ LocalNotification.prototype = {
var plugin = new LocalNotification();
module.exports = plugin;
\ No newline at end of file
module.exports = plugin;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment