diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2020-08-28 15:22:56 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2020-08-28 15:22:56 -0400 |
| commit | 25211b7d46c08788f390f6f220428b6f179e5ed2 (patch) | |
| tree | d3354e2f695909fff0dc6eaebece0e950b33e823 /www/js/EventCtrl.js | |
| parent | 1c2ba2c9db76c4e328bd70dc7ffc195ecea7a161 (diff) | |
#962 feature complete compared to push plugin
Diffstat (limited to 'www/js/EventCtrl.js')
| -rw-r--r-- | www/js/EventCtrl.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index 40762f6b..3027de01 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -2475,25 +2475,23 @@ angular.module('zmApp.controllers') $scope.popover = popover; }); + // coming to this view clears all notification badges EventServer.sendMessage('push', { type: 'badge', badge: 0, }); + // also clear bells + $rootScope.alarmCount = "0"; + $rootScope.isAlarm = !$rootScope.isAlarm; - - - //reset badge count - if (window.cordova && window.cordova.plugins.notification) { - $cordovaBadge.set(0).then(function () { - // You have permission, badge set. - }, function (err) { - NVR.debug("app does not have badge permissions. Please check your phone notification settings"); - // You do not have permission. - }); + // reset badge count + if (window.FirebasePlugin && $rootScope.platformOS == 'ios') { + NVR.debug ('Clearing app badge count'); + window.FirebasePlugin.setBadgeNumber(0); - $cordovaLocalNotification.clearAll(); } - + + }); $scope.$on('$ionicView.leave', function () { |
