mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Inicialize and register browser for web notification
This commit is contained in:
@@ -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']) {
|
||||
|
||||
Reference in New Issue
Block a user