Caching nav state for ios PWA

Hey folks,

I’m using ionic to create a PWA, however I’m running into trouble on iOS. The current state is dropped as soon as a user leaves the app, so even if an app is briefly swapped, you end up back at the root page. Android thankfully doesn’t have this issue.

Is there any way of storing the current nav state in localStorage or indexedDB, and then re-injecting it into the app when the user re-opens the app so it restores their last view?

Which iOS version?

Maybe your issue is linked to the fact that service workers were just released on iOS 11.3 and that you are testing on a previous iOS version?

I haven’t tested with 11.3 yet, will do later today, but according to this summary on how things are with 11.3, nothing has changed:
“Your PWA won’t keep state between sessions, if the user gets out of a PWA, it will be restarted when coming back, so if you need the user to validate an email, SMS or do a two-factor authentication, have that in mind to offer a proper solution.”

You are right, maybe it gonna be the same on iOS 11.3. I would be curious about the result if you don’t mind trying

with this you mean actually closing (“killing”) the app or just put in the background?

sorry actually I don’t have then an answer but really looking forward to the next posts here

"iOS reloads PWAs every time they get on screen"


"iOS 11.3 update"

The camera issue has been fixed in 11.3: iOS 11 its not me its you (tags: iOS11, PWA, Camera)

Ionic 3 PWA (iOS and Android screen shots):

Yep, still the same in Ios11.3

Does anyone know how to save ionichistory and then restore it?

Maybe you could try opening an issue/support request in the ionic-pwa-toolkit project?

Btw. just had a test too, is it possible that PWAs on iOS even don’t maintain storage values respectively that the storage is empty each time the PWA start? Do you face this too?