Fixe merge

This commit is contained in:
Peter Maquiran
2021-01-29 14:11:05 +01:00
412 changed files with 7072 additions and 32695 deletions
+33 -1
View File
@@ -4,6 +4,10 @@ import { formatDate } from '@angular/common';
import { Event } from '../models/event.model';
import { ProcessesService } from '../services/processes.service';
import { Plugins, PushNotification,PushNotificationToken,PushNotificationActionPerformed} from '@capacitor/core';
const { PushNotifications } = Plugins;
@Component({
selector: 'app-home',
templateUrl: './home.page.html',
@@ -39,8 +43,36 @@ export class HomePage implements OnInit {
this.processesbackend.GetTasksList("Expediente", true).subscribe(result =>{
this.totalExpediente = result;
});
}
(PushNotifications as any).requestPermission().then(result => {
PushNotifications.register();
});
PushNotifications.addListener(
'registration',
(token: PushNotificationToken) => {
/* alert('Push registration success, token: ' + token.value); */
console.log('FIREBASE: ', token.value)
},
);
PushNotifications.addListener('registrationError', (error: any) => {
alert('Error on registration: ' + JSON.stringify(error));
});
PushNotifications.addListener(
'pushNotificationReceived',
(notification: PushNotification) => {
alert('Push received: ' + JSON.stringify(notification));
},
);
PushNotifications.addListener(
'pushNotificationActionPerformed',
(notification: PushNotificationActionPerformed) => {
alert('Push action performed: ' + JSON.stringify(notification));
},
);
}
}