import { Injectable } from '@angular/core'; import { Platform } from '@ionic/angular'; import { CapacitorConfig } from '@capacitor/cli'; /* import { LocalNotifications, LocalNotificationSchema } from '@capacitor/local-notifications'; */ @Injectable({ providedIn: 'root' }) export class NativeNotificationService { constructor(private platform: Platform,) { this.askForPermission() } askForPermission() { /* LocalNotifications.requestPermissions() LocalNotifications.checkPermissions().then((data)=>{ // }).catch((data)=>{ // }) */ } foregroundNotification() { /* LocalNotifications.addListener('localNotificationReceived', (notification) => { }) */ } backgroundNotification() { /* LocalNotifications.addListener('localNotificationActionPerformed', (action) => { console.log('Local notification action performed (background):', action); // Implemente a lógica para lidar com a ação da notificação em segundo plano }); */ } sendNotificationChat({title = 'User', icon = '', message = 'hello'}) { /* LocalNotifications.schedule({ notifications:[ { title : title, body : message, id : new Date().getTime() } ] }); */ } isDesktop() { if (this.platform.is('desktop') || this.platform.is('mobileweb')) { return true } else { return false } } }