Skip to content

Instantly share code, notes, and snippets.

@stramargio
Created May 20, 2015 11:35
Show Gist options
  • Save stramargio/df0bdd612184e5d9aa3d to your computer and use it in GitHub Desktop.
Save stramargio/df0bdd612184e5d9aa3d to your computer and use it in GitHub Desktop.
Notifiche Locali
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.singlePushMessageID);
console.log(_notification.singlePushMessageText);
cordova.plugins.notification.local.schedule({
id: _notification.singlePushMessageID,
title: _notification.singlePushMessageTitle,
text: _notification.singlePushMessageText,
firstAt: _notification.singlePushMessageStart,
every: _notification.singlePushMessageRepeat,
data: { standUrlToOpen: _notification.anchor }
});
// cordova.plugins.notification.local.on("click", function (notification) {
// $('#maincontent').attr('src', notification.data.standUrlToOpen);
// });
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment