Remove notification foreground

This commit is contained in:
Eudes Inácio
2021-08-18 17:36:40 +01:00
parent 073016ca73
commit 981f69d65e
4 changed files with 56 additions and 22 deletions
+14 -1
View File
@@ -165,6 +165,16 @@ export class NotificationsService {
}
removeDepartment(index): void {
/* this.DataArray[this.DataArray.findIndex(item => item.index == index)];
this.DataArray.splice( this.DataArray.findIndex(item => item.indexOf(index.to) === 'William'),1); */
const indexx = this.DataArray.indexOf(index, 0);
if (indexx > -1) {
this.DataArray.splice(index, 1);
console.log('This notificatio', this.DataArray);
}
}
async onReceviNotification() {
if(window['WLAuthorizationManager']) {
@@ -185,6 +195,7 @@ export class NotificationsService {
var notificationReceived = (message) => {
//this.jsonstore.createCollection('Notifications',message);
this.DataArray.push(message)
console.log("On ReceiveNotification", message)
this.storageService.store("Notifications",JSON.stringify(this.DataArray))
console.log(message);
@@ -196,7 +207,9 @@ export class NotificationsService {
if(message.actionName){
this.notificatinsRoutes(data);
} else {
this.toastService.notificationMessage(message.alert,this.notificatinsRoutes, data);
/* this.toastService.notificationMessage(message.alert,this.notificatinsRoutes, data); */
//this.notificatinsRoutes(data);
console.log(data)
}
}
+6
View File
@@ -18,6 +18,12 @@ const { Storage } = Plugins; */
const ret = await this.storage.get(key).then((val) => { return val; });
return JSON.parse(unescape(atob(ret)));
}
async remove(key: string){
await this.storage.remove(key);
}
/*
// Get the value
async get(storageKey: string) {