improve monitoring the solution

This commit is contained in:
Peter Maquiran
2024-07-30 15:52:07 +01:00
parent 8f0625eed4
commit edcaf951c2
11 changed files with 167 additions and 27 deletions
+3 -5
View File
@@ -124,10 +124,9 @@ export class NotificationsService {
if (this.platform.is('ios')) {
FCM.getToken()
.then(r => {
tracing.setAttribute('notification.token', 'true')
this.postToken(r.token, geturl, tracing)
this.token = r.token
tracing.setAttribute('notification.token', 'true')
tracing.setAttribute('outcome', 'success')
// alert(this.token)
})
.catch(err => {
@@ -139,9 +138,10 @@ export class NotificationsService {
PushNotifications.addListener('registration',
(token: Token) => {
tracing.setAttribute('notification.token', 'true')
this.postToken(token.value, geturl, tracing)
this.token = token.value
tracing.setAttribute('notification.token', 'true')
}
);
@@ -157,13 +157,11 @@ export class NotificationsService {
this.token = token
tracing.setAttribute('notification.token', 'true')
tracing.setAttribute('outcome', 'success')
tracing.finish()
},
(error) => {
console.error('Permission denied:', error);
tracing.setAttribute('notification.token', 'false')
tracing.setAttribute('outcome', 'failed')
tracing.finish()
}
);
}