I'm trying to put web notifications on my website so that all my clients see my notification in the browser when I add a new element on my website, so for this I selected angular-web-notification , I installed via bower in my application and tested it on locally, it worked fine, but when I deployed my site for production, I tested it again in production, the notification comes only in my browser, not only for all clients who allowed notifications for my site.
Here is my code in the JS file
.directive('showButton', ['webNotification', function (webNotification) { return { restrict: 'C', scope: { notificationTitle: '=', notificationMsg: '=', notificationUrl: '=' }, link: function (scope, element) { console.log("coming to directive notifications") element.on('click', function onClick() { console.log("coming to directive notifications click") if ((scope.notificationTitle) && (scope.notificationMsg)) { webNotification.showNotification(scope.notificationTitle, { body: scope.notificationMsg, icon: 'https://lh3.googleusercontent.com/BCOE0vqCfr8aqpIKEF7QEt-qa7p8I7KDg58Juz6M6_YGb4l7phrO2vMvi_SDy10ucQ=w300', onClick: function onNotificationClicked() { console.log('Notification clicked.'); window.open(scope.notificationUrl, '_blank') }, autoClose: 4000
javascript angularjs push-notification angularjs-directive web-notifications
Midhunsai
source share