Any way to disable idle timer screen locking in PhoneGap Build?

  • 19
  • Question
  • Updated 6 years ago
  • Answered
It's doable on iOS and Android but requires native code, so solutions that work there don't work with PhoneGap Build. There is also a plugin but it's not supported.

Based on the number of questions on StackOverflow this seems to be a pretty common app requirement.
Photo of Joel

Joel

  • 3 Posts
  • 1 Reply Like

Posted 8 years ago

  • 19
Photo of Andrew Lunny

Andrew Lunny

  • 1911 Posts
  • 199 Reply Likes
It's not something we currently support - I'll mark it on our internal issue tracker as feature request.
Photo of ben.millspaugh

ben.millspaugh

  • 3 Posts
  • 0 Reply Likes
Andrew, has this feature request made any progress in the past month? It seems like a very simple change to make and it only needs to be implemented in the PhoneGap:Build config.xml file, so it is not like it has to be released with a specific version of PhoneGap.....it should work for all versions automatically since it is only a build flag, and not internal to the application.

Please let us know where you stand with this issue.....is there a tracking number that we can use to check the status? Currently the ONLY reason we can't use PhoneGap:Build to compile our apps is this issue. Please consider adding it ASAP. Thank you in advance for any help you can provide to expedite this issue.
Photo of ben.millspaugh

ben.millspaugh

  • 3 Posts
  • 0 Reply Likes
Please do!!! This is very important for geolocation apps and the like which need the idle timer disabled. It is a simple flag to set in iOS (https://developer.apple.com/library/i...) and it sounds like Android has something similar. Can you add this as an option to the config file? Really needed, I can only use PhoneGap:Build for development due to this one missing feature....for production I have to use iOS only to set this one setting. Thanks in advance for adding this feature!
Photo of Lusky

Lusky

  • 2 Posts
  • 0 Reply Likes
It's important for me too because in my game (sudoku) user is thinking about next placement and just at the moment he is almost decided ZAS! screen dark, and he hates me and my game!
Photo of Pavel Polyakov

Pavel Polyakov

  • 9 Posts
  • 0 Reply Likes
I share the idea that it's important to be able to prevent the screen locking for various kind of applications, especially for geolocation, since phonegap is not able to work in the background.

Please, implement this, I'll wait patiently :)
Photo of Joel

Joel

  • 3 Posts
  • 1 Reply Like
Pavel, it's good of you to offer to wait patiently, but my team doesn't have the luxury of patience with a pending app release. This is unfortunately a deal-breaker for our app and, I imagine, many others.
Photo of Andrew Lunny

Andrew Lunny

  • 1911 Posts
  • 199 Reply Likes
After looking through the documentation, it looks as though this is better suited for a PhoneGap plugin than a config.xml property (as your app should disable this property once it's done).

I'm going to work on this plugin and see if something can be readied asap.
Photo of Drew Dara-Abrams

Drew Dara-Abrams

  • 1 Post
  • 0 Reply Likes
Will this plugin do what you're all trying for? https://github.com/phonegap/phonegap-...
Photo of sweppner

sweppner

  • 1 Post
  • 0 Reply Likes
Hey Andrew, has there been any progress on this?
Photo of Bryan Moodie

Bryan Moodie

  • 1 Post
  • 0 Reply Likes
Hi Andrew, I'm keen for news on this too. I have a client who needs this feature and is asking about it, without it I'll have to roll my own. TIA!
Photo of Ewald Bos

Ewald Bos

  • 2 Posts
  • 0 Reply Likes
Hi Andrew, Any news, now playing a long audio file and the app goes to sleep, audio stops and the buttons are reset. How to solve this without a prevent idle function?
Photo of Ewald Bos

Ewald Bos

  • 2 Posts
  • 0 Reply Likes
@ Joel: can you point me in the directions of making it with native code?
Photo of Andrew Lunny

Andrew Lunny

  • 1911 Posts
  • 199 Reply Likes
Things were held up while we were preparing the 1.0 release (for Monday's event).

I have a version of the plugin available here, that you can use if you're building locally:
https://github.com/alunny/ScreenDim

I'm going to work on getting that plugin into PhoneGap Build as soon as possible.
Photo of Michael Clark

Michael Clark

  • 14 Posts
  • 2 Reply Likes
Hi Andrew.
I'm new to this, can you point me in the right direction to see how it's done please?
Regards
Robyn
Photo of Adib R

Adib R

  • 2 Posts
  • 0 Reply Likes
Hey, so any ETA on when we can expect to have this as part of a config.xml file or such? (Or even just instructions so phone gap build, truly supports this lock-out feature)
Photo of nbruley

nbruley

  • 35 Posts
  • 0 Reply Likes
Looking forward to having this available also.
Photo of Rckt

Rckt

  • 5 Posts
  • 0 Reply Likes
Added this to the Future Plugin Support thread, as would be really useful to have this incorporated.
Photo of calebeaires

calebeaires

  • 23 Posts
  • 0 Reply Likes
Hy Andrew. Any news about the plugin to PhoneGap Build. We really need this PowerManagement (at least: force screen on).
Photo of Kim Ras

Kim Ras

  • 45 Posts
  • 0 Reply Likes
+1
It would be a cool thing.. I kind a need it as well.
Thanks
Kim
Photo of ackava

ackava

  • 1 Post
  • 0 Reply Likes
Screen on is a must, we have to tell our users to tap screen every 10 seconds, which is so annoying for users as they have to upload a big file. File upload stops when phone is locked.
Photo of Dvir Levy

Dvir Levy

  • 1 Post
  • 0 Reply Likes
Hello
any updates on this?
Photo of calebeaires

calebeaires

  • 23 Posts
  • 0 Reply Likes
It seans Adobe Phonegap Build are not getting this issue as important!
Photo of Dan Michelson

Dan Michelson

  • 14 Posts
  • 0 Reply Likes
Hello, I need it too for my app, any updates?
Thank You
Photo of michote

michote

  • 1 Post
  • 0 Reply Likes
I need it, too.
Photo of Bill Fergusson

Bill Fergusson

  • 4 Posts
  • 0 Reply Likes
Surely there is enough requests now to get this into Phonegap Build?? We got PowerManagement working easily on Android, but can't find a simple way to implement that or ScreenDim on iOS using Phonegap Build.

We have an application where a contractor is following a route to various places, and inputting data relevant to that place, with screen base information remaining constant for that route. We NEED to be able to disable the timeout for that screen only (and of course re-enable it when the route is finished) so that the driver does not have to start again at each location.

HELP!!!!!
Photo of Greg Foote

Greg Foote

  • 6 Posts
  • 1 Reply Like
Is this feature in the PhoneGap Build config.xml plugins yet ??

Thanks
Greg
Photo of Alessandro Nunes

Alessandro Nunes

  • 5 Posts
  • 0 Reply Likes
Phonegap Build 2.5. Cordova on 2.7. And what about this? This is important! Thanks.

This conversation is no longer open for comments or replies.