From c5242991bff1557d33e61a632d0e504e68ed50d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Fri, 25 Jun 2021 14:37:52 +0100 Subject: [PATCH] Notification Route for despachos added --- src/app/home/home.page.ts | 6 ++++-- src/app/services/notifications.service.ts | 9 ++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index c9c6a9591..841a86ff0 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -66,10 +66,12 @@ export class HomePage implements OnInit { } ngOnInit() { - if(!this.platform.is('desktop')) { + if(this.platform.is('desktop') || this.platform.is('mobileweb')) { + console.log('Notifications not supported') + } else { this.mobilefirstConnect(); this.notificatinsservice.onReceviNotification(); - } + } this.count(); } diff --git a/src/app/services/notifications.service.ts b/src/app/services/notifications.service.ts index 0846829e1..bf7396d88 100644 --- a/src/app/services/notifications.service.ts +++ b/src/app/services/notifications.service.ts @@ -35,7 +35,7 @@ export class NotificationsService { } getAndpostToken(username) { - if (this.platform.is('desktop')) { + if (this.platform.is('desktop') || this.platform.is('mobileweb')) { console.log('Notifications not supported') } else { @@ -133,6 +133,13 @@ export class NotificationsService { } else if (data.Service === "gabinete-digital" && data.Object === "event-list") { this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',data.IdObject, 'gabinete-digital'])); + }else if (data.Service === "gabinete-digital" && data.Object === "despachos") { + let navigationExtras: NavigationExtras = { + queryParams: { + "serialNumber": data.IdObject, + } + }; + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos/despacho'], navigationExtras)); } else if (data.Service === "gabinete-digital" && data.Object === "parecer") { let navigationExtras: NavigationExtras = {