An open API service indexing awesome lists of open source software.

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.

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
});
```