Disable screen lock when Cordova app is running

Rocx

I don't know where to start. I am searching for this from yesterday but didn't got any idea.

I have a Cordova android app. It is working fine but if user is not doing anything then screen get locked and app will go to background/pause.

I want to keep the phone stay awake when app is running.

Is there any plugins/example for the same?

Ernesto Schiavo

You can use this plugin in order to prevent device from falling asleep.

In order to achive that you can call this method:

window.plugins.insomnia.keepAwake()

And then, to enable it again, you have to use:

window.plugins.insomnia.allowSleepAgain()

Please look at the Github page for more details

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How to disable Windows 10 Mail app mail count in tile and lock screen

分類Dev

Disable Windows Lock Screen - Win 8.1

分類Dev

Lock screen orientation to portrait when scanning with Zxing library, Xamarin.android app.

分類Dev

ios 8 app shortcut in lock screen

分類Dev

ios 8 app shortcut in lock screen

分類Dev

Must Cordova app webview take full screen?

分類Dev

How to disable Windows 10 lock screen password on IDLE only

分類Dev

Can't disable lock-screen in Ubuntu Gnome 15.04

分類Dev

Access App Notification Settings for Lock screen on iOS 8

分類Dev

Mongo::Error::NoServerAvailable when running Rails app

分類Dev

Encoding issue when running Gradle app distributions

分類Dev

Beacon Notification when the app is not running on Android

分類Dev

How to disable iPhone/iPad auto-lock while app is in foreground mode?

分類Dev

IOS Cordova Lock SplashScreen Orientation

分類Dev

Weird blinking on the lock screen remote control client when stopping it from the client itself

分類Dev

How do i detect when android device screen is about to timeout or "Lock"?

分類Dev

How can I make Ubuntu not lock my screen when I close my laptop?

分類Dev

Issues using x11vnc when xfce's lock screen is active

分類Dev

What is the Intent to call "Choose screen lock" screen?

分類Dev

Ubuntu, lock screen but do not screensave

分類Dev

Writing an Android lock screen replacement?

分類Dev

When running yarn, yarn.lock file is generated with private token from bash

分類Dev

android: app stops and then crashes when the screen goes off

分類Dev

Android Thread: App hangs when screen turns off

分類Dev

cordova iOS custom splash screen

分類Dev

Possible to see POST when no option in BIOS to disable splash screen or quiet boot?

分類Dev

Keep broadcast receiver running when activity and/or app is closed?

分類Dev

Feign UnsatisfiedDependecyException when running my spring boot app

分類Dev

How to keep an IntentService running even when app is closed?

Related 関連記事

  1. 1

    How to disable Windows 10 Mail app mail count in tile and lock screen

  2. 2

    Disable Windows Lock Screen - Win 8.1

  3. 3

    Lock screen orientation to portrait when scanning with Zxing library, Xamarin.android app.

  4. 4

    ios 8 app shortcut in lock screen

  5. 5

    ios 8 app shortcut in lock screen

  6. 6

    Must Cordova app webview take full screen?

  7. 7

    How to disable Windows 10 lock screen password on IDLE only

  8. 8

    Can't disable lock-screen in Ubuntu Gnome 15.04

  9. 9

    Access App Notification Settings for Lock screen on iOS 8

  10. 10

    Mongo::Error::NoServerAvailable when running Rails app

  11. 11

    Encoding issue when running Gradle app distributions

  12. 12

    Beacon Notification when the app is not running on Android

  13. 13

    How to disable iPhone/iPad auto-lock while app is in foreground mode?

  14. 14

    IOS Cordova Lock SplashScreen Orientation

  15. 15

    Weird blinking on the lock screen remote control client when stopping it from the client itself

  16. 16

    How do i detect when android device screen is about to timeout or "Lock"?

  17. 17

    How can I make Ubuntu not lock my screen when I close my laptop?

  18. 18

    Issues using x11vnc when xfce's lock screen is active

  19. 19

    What is the Intent to call "Choose screen lock" screen?

  20. 20

    Ubuntu, lock screen but do not screensave

  21. 21

    Writing an Android lock screen replacement?

  22. 22

    When running yarn, yarn.lock file is generated with private token from bash

  23. 23

    android: app stops and then crashes when the screen goes off

  24. 24

    Android Thread: App hangs when screen turns off

  25. 25

    cordova iOS custom splash screen

  26. 26

    Possible to see POST when no option in BIOS to disable splash screen or quiet boot?

  27. 27

    Keep broadcast receiver running when activity and/or app is closed?

  28. 28

    Feign UnsatisfiedDependecyException when running my spring boot app

  29. 29

    How to keep an IntentService running even when app is closed?

ホットタグ

アーカイブ