Created
May 20, 2015 11:35
-
-
Save stramargio/df0bdd612184e5d9aa3d to your computer and use it in GitHub Desktop.
Notifiche Locali
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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