https://github.com/kolbasa/cordova-plugin-screenstatus
Cordova plugin to monitor status changes of the screen.
https://github.com/kolbasa/cordova-plugin-screenstatus
android listener off on power screen status
Last synced: about 1 month ago
JSON representation
Cordova plugin to monitor status changes of the screen.
- Host: GitHub
- URL: https://github.com/kolbasa/cordova-plugin-screenstatus
- Owner: kolbasa
- License: mit
- Created: 2022-02-13T11:36:06.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-13T16:53:31.000Z (over 4 years ago)
- Last Synced: 2025-03-02T21:16:41.587Z (over 1 year ago)
- Topics: android, listener, off, on, power, screen, status
- Language: Java
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Cordova ScreenStatus Plugin
=========================
Cordova plugin to monitor status changes of the screen.
Works even if the app is not in the foreground.
# Installation
### Cordova
cordova plugin add cordova-plugin-screenstatus
### Ionic + Cordova
ionic cordova plugin add cordova-plugin-screenstatus
### Capacitor
npm install cordova-plugin-screenstatus
# API
### subscribe()
```js
ScreenStatus
.subscribe(function(turnedOn) {
// true, false
})
.then(function () {
// subscribed
})
.catch(function (err) {
// something broke
});
```
### unsubscribe()
```js
ScreenStatus
.unsubscribe()
.then(function () {
// unsubscribed
})
.catch(function (err) {
// something broke
});
```