Inicialize and register browser for web notification

This commit is contained in:
Eudes Inácio
2021-09-07 12:09:01 +01:00
parent 23d73c6d5f
commit 7929d9f3fb
15 changed files with 282 additions and 331 deletions
+10 -3
View File
@@ -18,6 +18,8 @@ import { ExpedienteGdStore } from '../store/expedientegd-store.service';
import { InativityService } from '../services/inativity.service';
import { SessionStore } from '../store/session.service';
import { StorageService } from '../services/storage.service';
import { Media, MediaObject } from '@ionic-native/media/ngx';
import { File } from '@ionic-native/file/ngx';
@Component({
selector: 'app-home',
@@ -60,6 +62,9 @@ export class HomePage implements OnInit {
synchro = synchro
status:string="";
audioFile:MediaObject = this.media.create(this.file.externalRootDirectory+"/audioGabinete.mp3");
audioName:string="";
constructor(
private zone: NgZone,
private router: Router,
@@ -72,7 +77,9 @@ export class HomePage implements OnInit {
public documentCounterService: DocumentCounterService,
private despachoRule: DespachoService,
private inativityService: InativityService,
private storageService: StorageService,) {
private storageService: StorageService,
private media: Media,
private file: File ) {
this.router.events.subscribe((val) => {
document.querySelectorAll('ion-modal').forEach((e: any) => e.remove())
@@ -110,14 +117,14 @@ export class HomePage implements OnInit {
console.log('Active route ', this.router.url)
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.webnotification.webconnection();
this.webnotification.onReceviNotificationWeb();
this.webnotification.register();
} else {
this.mobilefirstConnect();
this.notificationsService.getAndpostToken2();
this.notificationsService.onReceviNotification();
}
}
mobilefirstConnect() {
if(window['WLAuthorizationManager']) {