mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Improve notification
This commit is contained in:
@@ -8,11 +8,7 @@ export class WebNotificationPopupService {
|
||||
|
||||
constructor( private platform: Platform) {
|
||||
|
||||
var myWorker = new Worker( new URL('./sw.js', import.meta.url));
|
||||
|
||||
myWorker.onmessage = function(oEvent) {
|
||||
console.log('Worker said : ' + oEvent.data);
|
||||
}
|
||||
navigator.serviceWorker.register(new URL('./sw.js', import.meta.url));
|
||||
|
||||
}
|
||||
|
||||
@@ -53,8 +49,6 @@ export class WebNotificationPopupService {
|
||||
return true;
|
||||
}
|
||||
|
||||
cc = 0;
|
||||
|
||||
sendNotification(e) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {}
|
||||
else {return false}
|
||||
@@ -63,7 +57,7 @@ export class WebNotificationPopupService {
|
||||
if (result === 'granted') {
|
||||
navigator.serviceWorker.ready.then((registration)=> {
|
||||
|
||||
registration.showNotification(e.Object+ this.cc, {
|
||||
registration.showNotification(e.Object, {
|
||||
body: e.Service,
|
||||
icon: 'assets/icon/favicon.png',
|
||||
requireInteraction: true,
|
||||
|
||||
Reference in New Issue
Block a user