Skip to content

Instantly share code, notes, and snippets.

@stramargio
Created May 20, 2015 12:55
Show Gist options
  • Save stramargio/36569f6bdf6f9367840c to your computer and use it in GitHub Desktop.
Save stramargio/36569f6bdf6f9367840c to your computer and use it in GitHub Desktop.
ciclo
setStandsLocalNotifications: function() {
cordova.plugins.notification.local.clearAll(function() {
console.log('clear delle notifiche impostate precedentemente');
}, this);
console.log('setto le notifiche locali');
for (var i = 0; i < config.stands.notifications.length; i++) {
var _notification = config.stands.notifications[i];
console.log('Testo per la notifica', _notification.pushID);
console.log(_notification.pushText);
var now = new Date().getTime(),
_secs_from_now = new Date(now + i*5*1000);
cordova.plugins.notification.local.schedule({
id: _notification.pushID,
title: '"' + _notification.pushTitle + '"',
text: '"' + _notification.pushText + '"',
firstAt: _secs_from_now,
every: '"' + _notification.pushEvery + '"'
});
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment