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 Becky McElroy

Becky McElroy

  • 3 Posts
  • 0 Reply Likes
We're converting our HTTP webapp client to PhoneGap for this very purpose -- would sure like to be able to use PhoneGap Build...
Photo of Taylor Clark

Taylor Clark

  • 6 Posts
  • 0 Reply Likes
I found a few solutions using native code, but would love to know if there's a way to avoid screen dimming using PhoneGap Build. Thanks for the hard work!
Photo of Peter Davis

Peter Davis

  • 6 Posts
  • 0 Reply Likes
I need this as a work around for GPS not working in the background.

Any idea when this will be added?!?
Photo of Doug Nelson

Doug Nelson

  • 36 Posts
  • 1 Reply Like
Can someone submit this as a user supplied plugin? I'm not setup for native iOS builds
Photo of Doug Nelson

Doug Nelson

  • 36 Posts
  • 1 Reply Like
I added this as user supplied plugin for iOS. It's available now, and it does work.
Photo of nbruley

nbruley

  • 35 Posts
  • 0 Reply Likes
Thanks Doug. Where do we go to get this?
Photo of Doug Nelson

Doug Nelson

  • 36 Posts
  • 1 Reply Like
Photo of Kim Ras

Kim Ras

  • 45 Posts
  • 0 Reply Likes
This is cool, I really like the new Plugin Infrastructure...
Photo of Roman Azarov

Roman Azarov

  • 12 Posts
  • 0 Reply Likes
Hi, all. Is it possible to using PowerManagement plugin with Build.PhoneGap on android?
Photo of Matthew Rice

Matthew Rice

  • 3 Posts
  • 0 Reply Likes
I've forked Andrew Lunny/alunny's ScreenDim plugin and made the necessary adjustments to have it conform with a PhoneGap Build plugin.

It's URL is https://build.phonegap.com/plugins/295 ( though you won't be able to view it while it's under review ), but hopefully it gets approved for all to use.

Support is for iOS/Android.
Photo of Dan Michelson

Dan Michelson

  • 14 Posts
  • 0 Reply Likes
Hi All,
It is working!

At config.xml add:
#gap:plugin name="com.simplec.plugins.powermanagement" /#

Include:
#script src="phonegap.js"##/script#
#script src="PowerManagement.js"#

after device is ready, call:
window.plugins.powerManagement.acquire(function() {alert('ok');},function() {alert("not ok");});

Thank you very much :)
Photo of nbruley

nbruley

  • 35 Posts
  • 0 Reply Likes
So for Android, we just use the code Dan specified above (with <> instead of #) without adding any extra files since they are included in phonegap build, correct? https://build.phonegap.com/docs/plugi...

For iOS where you have to use Xcode, do you need to include all of the source files and follow instructions like this? http://www.adobe.com/devnet/phonegap/...
Photo of Dan Michelson

Dan Michelson

  • 14 Posts
  • 0 Reply Likes
Hello nbruley.

For me it work on IOS, I did not check it yet on Android.
Photo of Matthew Rice

Matthew Rice

  • 3 Posts
  • 0 Reply Likes
The biggest problem with "PowerManagement" ( at least for me ) is that it's supported versions are: 2.5.0, 2.7.0, 2.9.0. Specifically, no 3.X. I inquired to see if newer support could be implemented, but didn't hear back, which is why I submitted my Plugin ( which is still under review ), as I tried to provide as much support as possible with coverage for: 2.5.0, 2.7.0, 2.9.0, 3.0.0, 3.1.0 for *both* Android and iOS.
Photo of Fenn

Fenn

  • 1 Post
  • 0 Reply Likes
Is there any news on Matthew Rice's plugin ?
Photo of Gregory Hanis

Gregory Hanis

  • 6 Posts
  • 0 Reply Likes
still waiting for a solution
Photo of Görkem Karadoğan

Görkem Karadoğan

  • 2 Posts
  • 0 Reply Likes
I use background services for phonegap and pushnotification, these plugins run correctly but when I lock the screen, I am no longer able to push notifications.

How can ensure push notifications are received when I lock the screen?
Photo of Amir

Amir

  • 8261 Posts
  • 263 Reply Likes
Topic no longer active (too old). Please create new topic if needed.

Thanks


This conversation is no longer open for comments or replies.