From 25211b7d46c08788f390f6f220428b6f179e5ed2 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Fri, 28 Aug 2020 15:22:56 -0400 Subject: #962 feature complete compared to push plugin --- www/js/EventCtrl.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'www/js/EventCtrl.js') 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 () { -- cgit v1.2.3