1

I added a web app manifest to my web app and now I can add my web app to my iPhone home screen. I also added google workbox and implemented some caching strategies. Unfortunately when closing my web app and open it again, it always shows the start screen. I would like to jump back to the last seen screen automatically (call the last opened url) instead of always jumping to the starting page.

Is there a way to achieve this? Thanks in advance!

user3122136
  • 161
  • 4
  • 15

1 Answers1

0

One possible way
-- Subscribe to your router

this.router.events.subscribe(event => {
  if (event instanceof NavigationEnd) {
    // call a method here to save the current 
    // page to a local storage variable
  }
});  

When your app opens, if there is a value in local storage, go to that page

Mathias
  • 4,243
  • 4
  • 25
  • 34