mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
Fixe merge
This commit is contained in:
@@ -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));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user