WakeyWakey: The OutSystems Wake Lock Component
A reusable JavaScript component for OutSystems that uses the [Screen Wake Lock API](https://developer.mozilla.org/en-US/docs/Web/API/WakeLock) to ensure that mobile device screens don't automatically turn off. Can be used in Web and PWA apps.
Features:
Requirements:
Installation:
If your native app uses a modern WebView (e.g., Android System WebView 94+ or WKWebView on iOS 15+), you might be able to use this.
However:
It may not work reliably inside Cordova due to sandboxing or missing permissions.
You need to handle visibility changes manually (the wake lock may auto-release when the app goes to background).
So while the Web API can work in some modern environments, Cordova’s native plugin is far more reliable.In native Cordova apps, the JavaScript Wakelock API (like navigator.wakeLock) is not natively supported in older WebViews.Instead, you use a Cordova plugin that provides native access to Android’s or iOS’s power management APIs.
navigator.wakeLock
Common plugin:
cordova plugin add cordova-plugin-insomnia (Forge component available!)
cordova plugin add cordova-plugin-insomnia (
Forge component available
!)
cordova-plugin-insomnia
BSD-3 license (https://opensource.org/licenses/BSD-3-Clause)