Hi I want to know if there is a way with js or sth else that can prevent device go to sleep in a iOS web app.
Asked
Active
Viewed 842 times
0
-
http://stackoverflow.com/questions/7477424/html5-app-screen-sleep-timeout-on-ipad?rq=1 – Xpundel Apr 22 '13 at 10:23
-
I am confused , some comments said yes and some said no :-s – user2207044 Apr 22 '13 at 16:26
1 Answers
3
If you are talking about an iOS app that uses a webview then call the following method locally from js. This requires a native iOS app to work.
application.idleTimerDisabled = YES
Another hack from a true web app (non native) is to play an audio file constantly as some others have pointed out.
<audio src="loop.mp3" onended="this.play();" controls="controls" autobuffer></audio>

Mark McCorkle
- 9,349
- 2
- 32
- 42