Loading src/windows/LocalNotificationCore.js +20 −1 Changes for src/windows/LocalNotificationCore.js: 20 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -54,8 +54,8 @@ exports.core = { * 'schedule' or 'update' */ schedule: function (notifications) { var triggerFn = function (notification) { this.updateBadge(notification.badge); this.fireEvent('trigger', notification); }; Loading Loading @@ -127,6 +127,25 @@ exports.core = { this.scheduleLocalNotification(notification, properties); }, /** * Updates the badge number of the active tile. * * @param {Number} badge * The badge number. Zero will clean the badge. */ updateBadge: function (badge) { var notifications = Windows.UI.Notifications, type = notifications.BadgeTemplateType.badgeNumber, xml = notifications.BadgeUpdateManager.getTemplateContent(type), attrs = xml.getElementsByTagName('badge'), notification = new notifications.BadgeNotification(xml); attrs[0].setAttribute('value', badge); notifications.BadgeUpdateManager.createBadgeUpdaterForApplication() .update(notification); }, /** * Updates a single local notification. * Loading Loading
src/windows/LocalNotificationCore.js +20 −1 Changes for src/windows/LocalNotificationCore.js: 20 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -54,8 +54,8 @@ exports.core = { * 'schedule' or 'update' */ schedule: function (notifications) { var triggerFn = function (notification) { this.updateBadge(notification.badge); this.fireEvent('trigger', notification); }; Loading Loading @@ -127,6 +127,25 @@ exports.core = { this.scheduleLocalNotification(notification, properties); }, /** * Updates the badge number of the active tile. * * @param {Number} badge * The badge number. Zero will clean the badge. */ updateBadge: function (badge) { var notifications = Windows.UI.Notifications, type = notifications.BadgeTemplateType.badgeNumber, xml = notifications.BadgeUpdateManager.getTemplateContent(type), attrs = xml.getElementsByTagName('badge'), notification = new notifications.BadgeNotification(xml); attrs[0].setAttribute('value', badge); notifications.BadgeUpdateManager.createBadgeUpdaterForApplication() .update(notification); }, /** * Updates a single local notification. * Loading