Route to screen with push

This commit is contained in:
Eudes Inácio
2021-06-16 08:37:31 +01:00
parent b394360f0a
commit e0ec17e12d
2 changed files with 85 additions and 62 deletions
-1
View File
@@ -10569,7 +10569,6 @@
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"dev": true,
"requires": {
"is-glob": "^4.0.1"
}
+29 -5
View File
@@ -78,7 +78,11 @@ export class HomePage implements OnInit {
}
ngOnInit() {
if (this.platform.is('desktop')) {
console.log('Notifications not supported')
} else {
this.wlCommonInit();
}
//Add a test
//this.pushCordova();
@@ -169,15 +173,35 @@ export class HomePage implements OnInit {
alert(message.alert);
console.log(message)
var jsonObject = JSON.parse(message.payload);
console.log(jsonObject.service);
console.log(jsonObject.IdObject);
console.log(jsonObject.object);
var data = JSON.parse(message.payload);
console.log(data.Service);
console.log(data.IdObject);
console.log(data.Object);
if (data.Service === "agenda") {
//this.router.navigate(['/home/', service, IdObject, 'home']);
this.viewEventDetail(data.IdObject)
}
else if (data.Service === "gabinete-digital" && data.Object === "expediente") {
console.log('expediante 1')
this.viewExpedientDetail(data.IdObject)
}
else if (data.Service === "gabinete-digital" && data.Object === "event-list") {
// this.ngZone.run(() => {this.router.navigate(['/home/gabinete-digital/event-list', IdObject])})
this.openApproveModal(data.IdObject);
}
else if (data.Service === "accoes" && data.Object === "accao") {
this.viewPublications(data.IdObject)
alert(data.IdObject)
}
else if (data.Service === "accoes" && data.Object === "publicacao") {
this.viewPublicationDetail(data.IdObject)
}
}
}, (error) => {
console.log('Push notification recived: failure ' + error.responseText);
console.log(JSON.stringify(error))
console.log(JSON.stringify(error));
}
);