2

I'm working on a mobile web app in which I need Pusher's javascript server to keep on getting triggers such that the page will keep on getting updates.

Unfortunately, the auto screen lock pauses the procedure.

Is there a way to cause the mobile browser to prevent the device from auto locking?

  • 2
    The stock (Android) browser on the device? Don't think so. If you build your own apk that just contains a webview that you are displaying your web app in, then yes, just acquire a wakelock. No idea about ios though. – FoamyGuy May 27 '12 at 19:07
  • In iOS it is about the same Tim said. In the stock Safari you can't change device settings. But if you made an actual app instead of a lazy app you could have more control over the accelerometer. – Ryan Poolos May 27 '12 at 19:27
  • 1
    @Tim On Android, I'm talking about Firefox, since the stock browser doesn't support websockets anyway. btw, is it possible to set the browsers (Firefox/Safari) not to auto lock device? – user1364136 May 27 '12 at 21:10
  • as a workaround : is there a way to execute a refresh or an ajax request when reactivating device after auto lock? – user1364136 May 27 '12 at 22:10
  • 1
    These guys have already answered: http://stackoverflow.com/questions/4504238/javascript-code-to-prevent-screensaver-from-starting – Barnash Jun 20 '12 at 05:10
  • 1
    @Barnash - do you even understand the question? Please dont put irrelevant links here. – Akash Kava Dec 08 '12 at 15:03

0 Answers0