Since iOS 13 (perhaps also at the end of iOs 12...) the webapps in fullscreen mode doesn't seems to refresh themselves when the user open it by clicking the icon on the iPhone homescreen...
See this video to see the 2 test cases below in live : https://tooliphone.net/temp/stackoverflow_58342896.mp4
Test case 1 : not in fullscreen
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<script type="text/javascript">
alert("test / IT IS in fullscreen !");
var today = new Date();
var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
var dateTime = date+' '+time;
document.write(dateTime);
</script>
</body>
</html>
- Visit this page on iOS / safari: https://dev.icustom.tooliphone.net/test
- Add it to the home screen (share button / add to home screen)
- Click the home screen icon: alert displayed / current date displayed (immediatly)
- Click the home screen icon AGAIN: alert displayed / current date updated (immediatly)
Test case 2 : IT IS in fullscreen
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="apple-mobile-web-app-capable" content="yes" />
</head>
<body>
<script type="text/javascript">
alert("test / IT IS in fullscreen !");
var today = new Date();
var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
var dateTime = date+' '+time;
document.write(dateTime);
</script>
</body>
</html>
Note the new line here to be installed as a webapp on the homescreen ("fullscreen"):
<meta name="apple-mobile-web-app-capable" content="yes" />
- Visit this page on iOS / safari: https://dev.icustom.tooliphone.net/test2
- Add it to the home screen (share button / add to home screen)
- Click the home screen icon: alert displayed / current date displayed (after a few seconds...)
- Click the home screen icon AGAIN: alert NOT displayed / current date NOT updated
The only way seems to be to kill the webapp on the iOS task manager and launch it again...
Question
Is there a way to force the webapp in fullscreen to refresh itself at launch (each time the user clicks on the home screen icon)?
I tried to relaod the page in javascript but of course as the alert doesn't executes, this kind of code neither...
window.location.reload();
thank you in advance, this drives me crazy!