Hi everyone, I have a problem with my PWA ionic5 + angular 10.x. on firebase.
All the data I use on the app is served only by localstorage so whenever I access the pwa I have already all the data on client side, I just need to update some data when it is needed.
Now, it works as it should without any issue, the problem is when I switch off the network simulating no internet connection then there is nothing to do the app doesnt even start, I only get the message from the browser saying no internet connection.
In the same moment I can inspect the localstorage and all the data are there available so I cannot understand what is wrong…
I just would need that the pwa to start as usual and access localstorage (in app.component) to get all the data needed to work.
Is there a way to have a control of the app on browser or in PWA mode if there is not an active connection?
P.S: I use ionic for the website, the pwa and the usual native versions.
Oh thank you I would appreciate it, the url is visible on the last screenshot aboove, I prefer not to type it directly
Another thing that I have seen is that if I turn off the connection once the home is loaded I can go everywhere (in all pages where it is not needed an authentication) without problems but if I hit reload, then nothing it doesnt start at all.
Maybe consider using the angular service worker out of the box, before trying to do your own customisations. And if you need to tweak the angular service worker, check how that is done.
Btw, if you want to do FCM using angular, you dont need to add additional service worker. FCM works fine with out-of-the-box service worker of angular. Just be aware that messaging in PWA wont work on iOS.
Nice suggestions, thank you!
By the way I have found what is the problem, it is the paypal script that it is launched by mistake on startup and if offline it gives error 504 stopping the execution. Once removed the paypal script in the head it starts working as usual even when offline.
In any case your suggestions will help me to make it better.
P.S: Yes I know that problem with iOS, I hope in the future it will be working there too…