apple-mobile-web-app-capable sites cannot prevent device idle timeout / sleep

Originator:dschmidt
Number:rdar://30184961 Date Originated:01/25/2017
Status:Open Resolved:
Product:Mobile Safari Product Version:10.2.1
Classification: Reproducible:always
 
Summary:
There is currently no way to disable the device idle timer on apple-mobile-web-app-capable sites. There are (dirty) hacks that do work on mobile Safari, but even these hacks stop working once added to a user's home screen as a mobile web app.

Not setting apple-mobile-web-app-capable when adding the page to your home screen, the various hacks (like the one in the attached sample html) keep working. But the cost is having an app that absolutely does NOT feel native.

There are tons of legitimate use cases that require UI which does NOT go to sleep without user interaction. While one might argue that those apps could be implemented as native apps, this argument would completely undermine the purpose of web apps as a whole.

The app I am building is supposed to be a very simple design sketching session timer, which would probably not even go through the AppStore approval process as it would likely be rejected for "not enough features". That app can currently can be found here btw. https://zeebn.cfapps.io for illustration purposes.

Apparently the approach used in my attached sample even used to work in iOS < 10.2 (see [2])

Steps to Reproduce:
* upload the attached static HTML page to a webserver
* open this page on an iOS device
* add it to your home screen
* open the web app from your home screen

Expected Results:
Device does not go into sleep mode after the screen has been tapped once.
(Tapping the screen is the user interaction required to make that hack work)

Actual Results:
Device goes to sleep after default idle timeout.

Version:
iOS 10.2.1, iPhone 7

Notes:
some resources with discussions and suggested (not working) hacks
[1] https://github.com/richtr/NoSleep.js/issues/27
[2] http://stackoverflow.com/questions/9709891/prevent-ios-mobile-safari-from-going-idle-auto-locking-sleeping

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!