0

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.

1 Answers1

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