Angular web notification does not arrive on other devices

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 //auto close the notification after 4 seconds (you can manually close it via hide function) }, function onShow(error, hide) { if (error) { window.alert('Unable to show notification: ' + error.message); } else { console.log('Notification Shown.'); setTimeout(function hideNotification() { console.log('Hiding notification....'); hide(); //manually close the notification (you can skip this if you use the autoClose option) }, 5000); } }); } }); } }; }]); 
+7
javascript angularjs push-notification angularjs-directive web-notifications
source share

No one has answered this question yet.

See related questions:

7728
How to redirect to another web page?
4829
How to include a javascript file in another javascript file?
1904
Get screen size, current web page and browser window
1623
How to check if the string "StartsWith" contains another string?
1599
How to move an element to another element?
1547
What is the best way to detect a mobile device?
1006
What is the difference between angular -route and angular -ui-router?
528
Can one controller call another?
432
Angular directives - when and how to use compilation, controller, prelink and post link
245
AngularJS ng style with conditional expression

All Articles