I have a web app running on an iPad. It is running in full-screen mode. If I task switch to another app (by double-clicking the home button etc), then switch back to my web app, then my web app restarts.
Is there any way to prevent the web app from restarting when it receives the focus after an iPad task switch? Obviously I just want it to show itself in exactly the state it was in when it lost focus.
Thanks.
First, Launch the “Settings” app. Navigate to General > Multitasking (this is called “Multitasking & Dock” on iOS 11 and 12). Find the Allow Multiple Apps, Persistent Video Overlay, and Gestures switches and tap each one to turn the features off.
Use the App SwitcherTo browse the open apps, swipe right, then tap the app or Split View workspace you want to use. You can view the Slide Over windows by swiping left, and switch between them by tapping them. See Switch between apps in Slide Over.
No, this is not possible.
The best way to act is to save a state into localStorage. If you're using eg. URL hash for tracking your state (eg. myApp.html/#loginScreen), one can store that info and then apply it on location.hash which would dispatch window.onhashchange.
In other words (codes are just example written on fly):
1 - store relevant information to localStorage:
localStorage.setItem("state", "loginScreen");
2 - retrieve value on start up and apply it to hash:
location.hash = (localStorage.getItem("state")) ? localStorage.getItem("state") : "";
3 - bind an event listener to onhashchange and proceed from there:
window.addEventListener("hashchange", function() {
if (location.hash.length) {
alert("Current state of UI is :"+ location.hash);
}
}, false);
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