Merge branch 'feature/viewer-attachment' of bitbucket.org:equilibriumito/gabinete-digital-fo into feature/viewer-attachment

This commit is contained in:
Peter Maquiran
2024-03-04 09:11:41 +01:00
6 changed files with 131 additions and 21 deletions
+9 -3
View File
@@ -65,6 +65,7 @@ export class NotificationsService {
}
requestPermissions() {
console.log('init notificaton permission')
if (this.platform.is('mobile')) {
if (!this.isPushNotificationsAvailable) {
@@ -72,17 +73,22 @@ export class NotificationsService {
}
PushNotifications.requestPermissions().then(async (result) => {
if (result.receive === 'granted') {
console.log('permission granted')
// Register with Apple / Google to receive push via APNS/FCM
try {
PushNotifications.register().catch((error) => {
console.log("Register device", error)
PushNotifications.register().then((value) => {
console.log("Register device", value)
this.getAndpostToken("")
}) .catch((error) => {
console.log("Register device error", error)
})
this.getAndpostToken("")
} catch (error) {
console.log("Granted permission error", error)
}
} else {
// Show some error
console.log('permission notification erro')
}
});
} else {