I'm working on a mobile web app (website) that requires you to add it to the home screen. When you open it, and switch to another app, then go back to my web app, the whole app reloads. It shows the splash screen and doesn't even remember where you last were.
Is there a way around this? I can't find any details in the iOS docs.
This has to do with how much RAM the device has. That device has 2 GB of RAM, which is pretty "weak" these days. With that little RAM, the OS has to aggressively unload apps from memory to make room for the next app you're opening (which then needs to load into RAM).
If you've ever rearranged the apps on your screen or deleted an app from your phone, you've seen icons shaking. That's because shaking icons mean that the iPhone is in the mode that lets you move or delete apps (in iOS 10 and up, you can even delete some of the apps that come built in to the iPhone).
Background App Refresh allows the apps on your iPhone to automatically search for new information even if they're not directly running on the screen. On Android devices, the background refresh function allows background data usage, and it works the same way.
It seems that this topic will answer your question.
You can't avoid this refresh behavior. You should work with the HTML5 local storage to persist the state of your application and use it when the application is launched to restore his state.
Here is a link to the Safari Developer Library focussing on your question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With