mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Improve responsiveness and add doc to task
This commit is contained in:
+38
-38
@@ -9,7 +9,7 @@ import { ModalController, AlertController, AnimationController, Platform } from
|
||||
/* import { Plugins, PushNotification, PushNotificationToken, PushNotificationActionPerformed, Modals } from '@capacitor/core'; */
|
||||
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 { ExpedienteDetailPage } from '../pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page';
|
||||
import { ViewPublicationsPage } from '../pages/publications/view-publications/view-publications.page';
|
||||
@@ -59,7 +59,7 @@ export class HomePage implements OnInit {
|
||||
private router: Router,
|
||||
private modalController: ModalController,
|
||||
public modalCtrl: AlertController,
|
||||
private fcm: FCM,
|
||||
// private fcm: FCM,
|
||||
private animationController: AnimationController,
|
||||
private notificatinsservice: NotificationsService,
|
||||
private platform: Platform) {
|
||||
@@ -103,51 +103,51 @@ export class HomePage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
pushCordova() {
|
||||
// pushCordova() {
|
||||
|
||||
if(this.platform.is('desktop')) {
|
||||
console.log('Notifications not supported')
|
||||
} else {
|
||||
// if(this.platform.is('desktop')) {
|
||||
// console.log('Notifications not supported')
|
||||
// } else {
|
||||
|
||||
this.fcm.onNotification().subscribe(data => {
|
||||
this.viewEventDetail(data.IdObject)
|
||||
if (data.wasTapped === true) {
|
||||
console.log("Received in background: ", data);
|
||||
// this.fcm.onNotification().subscribe(data => {
|
||||
// this.viewEventDetail(data.IdObject)
|
||||
// if (data.wasTapped === true) {
|
||||
// console.log("Received in background: ", data);
|
||||
|
||||
if (data.Service === "agenda") {
|
||||
//this.router.navigate(['/home/', service, IdObject, 'home']);
|
||||
this.viewEventDetail(data.IdObject)
|
||||
}
|
||||
else if (data.Service === "gabinete-digital" && data.Object === "expediente") {
|
||||
console.log('expediante 1')
|
||||
this.viewExpedientDetail(data.IdObject)
|
||||
}
|
||||
else if (data.Service === "gabinete-digital" && data.Object === "event-list") {
|
||||
// this.ngZone.run(() => {this.router.navigate(['/home/gabinete-digital/event-list', IdObject])})
|
||||
this.openApproveModal(data.IdObject);
|
||||
}
|
||||
else if (data.Service === "accoes" && data.Object === "accao") {
|
||||
this.viewPublications(data.IdObject)
|
||||
alert(data.IdObject)
|
||||
}
|
||||
else if (data.Service === "accoes" && data.Object === "publicacao") {
|
||||
this.viewPublicationDetail(data.IdObject)
|
||||
}
|
||||
// if (data.Service === "agenda") {
|
||||
// //this.router.navigate(['/home/', service, IdObject, 'home']);
|
||||
// this.viewEventDetail(data.IdObject)
|
||||
// }
|
||||
// else if (data.Service === "gabinete-digital" && data.Object === "expediente") {
|
||||
// console.log('expediante 1')
|
||||
// this.viewExpedientDetail(data.IdObject)
|
||||
// }
|
||||
// else if (data.Service === "gabinete-digital" && data.Object === "event-list") {
|
||||
// // this.ngZone.run(() => {this.router.navigate(['/home/gabinete-digital/event-list', IdObject])})
|
||||
// this.openApproveModal(data.IdObject);
|
||||
// }
|
||||
// else if (data.Service === "accoes" && data.Object === "accao") {
|
||||
// this.viewPublications(data.IdObject)
|
||||
// alert(data.IdObject)
|
||||
// }
|
||||
// else if (data.Service === "accoes" && data.Object === "publicacao") {
|
||||
// this.viewPublicationDetail(data.IdObject)
|
||||
// }
|
||||
|
||||
} else {
|
||||
console.log("Received in foreground: ", data);
|
||||
// } else {
|
||||
// console.log("Received in foreground: ", data);
|
||||
|
||||
console.log(data.Service)
|
||||
console.log(data.Object)
|
||||
console.log(data.IdObject)
|
||||
// console.log(data.Service)
|
||||
// console.log(data.Object)
|
||||
// console.log(data.IdObject)
|
||||
|
||||
};
|
||||
});
|
||||
}
|
||||
// };
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
async viewEventDetail(eventId: any) {
|
||||
console.log(this.profile);
|
||||
|
||||
Reference in New Issue
Block a user