This commit is contained in:
tiago.kayaya
2021-04-13 11:42:54 +01:00
parent 4949a0be72
commit 755ca81b63
+16 -9
View File
@@ -8,7 +8,7 @@ import { ModalController, AlertController, AnimationController } from '@ionic/an
/* import { Plugins, PushNotification, PushNotificationToken, PushNotificationActionPerformed, Modals } from '@capacitor/core'; */ /* import { Plugins, PushNotification, PushNotificationToken, PushNotificationActionPerformed, Modals } from '@capacitor/core'; */
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx'; //import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx';
import { ViewEventPage } from '../pages/agenda/view-event/view-event.page'; import { ViewEventPage } from '../pages/agenda/view-event/view-event.page';
import { ApproveEventModalPage } from '../pages/agenda/approve-event-modal/approve-event-modal.page'; import { ApproveEventModalPage } from '../pages/agenda/approve-event-modal/approve-event-modal.page';
import { ExpedienteDetailPage } from '../pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page'; import { ExpedienteDetailPage } from '../pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page';
@@ -52,7 +52,14 @@ export class HomePage implements OnInit {
postEvent: any; postEvent: any;
folderId: string; folderId: string;
constructor(private zone: NgZone, private eventService: EventsService, private processesbackend: ProcessesService, private router: Router, private modalController: ModalController, public modalCtrl: AlertController, private fcm: FCM, private animationController: AnimationController,) { constructor(private zone: NgZone,
private eventService: EventsService,
private processesbackend: ProcessesService,
private router: Router,
private modalController: ModalController,
public modalCtrl: AlertController,
//private fcm: FCM,
private animationController: AnimationController,) {
router.events.subscribe((val) => { router.events.subscribe((val) => {
document.querySelectorAll('ion-modal').forEach((e) => e.remove()) document.querySelectorAll('ion-modal').forEach((e) => e.remove())
@@ -66,8 +73,8 @@ export class HomePage implements OnInit {
ngOnInit() { ngOnInit() {
this.pushCordova() //this.pushCordova();
/* //Initialize profile as mdgpr //Initialize profile as mdgpr
let date = new Date(); let date = new Date();
date.setMonth(date.getMonth() + 1); date.setMonth(date.getMonth() + 1);
@@ -92,11 +99,11 @@ export class HomePage implements OnInit {
this.totalExpediente = result; this.totalExpediente = result;
}); });
*/
} }
pushCordova() { pushCordova() {
/*
this.fcm.onNotification().subscribe(data => { this.fcm.onNotification().subscribe(data => {
this.viewEventDetail(data.idObject) this.viewEventDetail(data.idObject)
if (data.click_action) { if (data.click_action) {
@@ -149,11 +156,11 @@ export class HomePage implements OnInit {
}); });
this.ubscribeToTopic() this.ubscribeToTopic()
this.getToken() this.getToken() */
} }
ubscribeToTopic() { /* ubscribeToTopic() {
this.fcm.subscribeToTopic('enappd'); this.fcm.subscribeToTopic('enappd');
} }
getToken() { getToken() {
@@ -162,7 +169,7 @@ export class HomePage implements OnInit {
// Register your new token in your back-end if you want // Register your new token in your back-end if you want
// backend.registerToken(token); // backend.registerToken(token);
}); });
} } */
async viewEventDetail(eventId: any) { async viewEventDetail(eventId: any) {
console.log(this.profile); console.log(this.profile);