fix ios notifications

This commit is contained in:
Lorito Tiago
2023-10-09 14:15:21 +01:00
parent 76f8ac976a
commit cca49822b3
70 changed files with 7451 additions and 44713 deletions
+23 -25
View File
@@ -164,8 +164,6 @@ export class HomePage implements OnInit {
this.logDeviceInfo();
this.notificationsService.onReciveForeground();
this.notificationsService.onReciveBackground();
window.addEventListener('online', () => {
this.backgroundservice.online()
@@ -238,20 +236,20 @@ export class HomePage implements OnInit {
}, 1000)
/* if (!this.platform.is('desktop')) {
App.addListener('appStateChange', ({ isActive }) => {
if (isActive) {
// The app is in the foreground.
console.log('App is in the foreground');
this.RochetChatConnectorService.connect()
this.reloadComponent(true)
} else {
// The app is in the background.
console.log('App is in the background');
// You can perform actions specific to the background state here.
}
});
} */
/* if (!this.platform.is('desktop')) {
App.addListener('appStateChange', ({ isActive }) => {
if (isActive) {
// The app is in the foreground.
console.log('App is in the foreground');
this.RochetChatConnectorService.connect()
this.reloadComponent(true)
} else {
// The app is in the background.
console.log('App is in the background');
// You can perform actions specific to the background state here.
}
});
} */
}
@@ -344,15 +342,15 @@ export class HomePage implements OnInit {
}
reloadComponent(self:boolean,urlToNavigateTo ?:string){
reloadComponent(self: boolean, urlToNavigateTo?: string) {
//skipLocationChange:true means dont update the url to / when navigating
console.log("Current route I am on:",this.router.url);
const url=self ? this.router.url :urlToNavigateTo;
this.router.navigateByUrl('/',{skipLocationChange:true}).then(()=>{
this.router.navigate([`/${url}`]).then(()=>{
console.log(`After navigation I am on:${this.router.url}`)
})
})
}
console.log("Current route I am on:", this.router.url);
const url = self ? this.router.url : urlToNavigateTo;
this.router.navigateByUrl('/', { skipLocationChange: true }).then(() => {
this.router.navigate([`/${url}`]).then(() => {
console.log(`After navigation I am on:${this.router.url}`)
})
})
}
}