This commit is contained in:
Peter Maquiran
2023-06-30 10:49:33 +01:00
12 changed files with 250 additions and 503 deletions
+20
View File
@@ -10,6 +10,7 @@ import { ThemeService } from 'src/app/services/theme.service';
import { environment } from 'src/environments/environment';
import { Storage } from '@ionic/storage';
import { ChatController } from './controller/chat';
import { AngularFireMessaging } from '@angular/fire/messaging';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: {
@@ -46,6 +47,25 @@ export class AppComponent {
ChatController.ChatSystemService = this.ChatSystemService
}
/* requestPermission() {
this.afMessaging.requestToken.subscribe(
(token) => {
// Save the token to your server for sending notifications
console.log('Permission granted! Token:', token);
},
(error) => {
console.error('Permission denied:', error);
}
);
}
receiveMessages() {
this.afMessaging.messages.subscribe((message) => {
console.log('Received message:', message);
// Handle the received message, e.g., show a notification
});
} */
initializeApp() {
this.platform.ready().then(() => {
this.statusBar.styleDefault();