Skip to content

mebibou/cordova-plugin-backlight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This plugin provides interface to turn on or off the backlight of the screen on your device. This is not like brightness, as this will completely turn off the backlight, showing nothing but a black screen.

Note: this plugin only works for Android for now, help wanted for iOs implementation.

Setup

Add the plugin using cordova cli:

cordova plugin add cordova-plugin-backlight

Javascript Interface

// turn on backlight
window.cordova.plugins.Backlight.on(function onSuccess() {
  // backlight is on
}, function onError(error) {
  console.error(error);
});

// turn off backlight
window.cordova.plugins.Backlight.off(function onSuccess() {
  // backlight is off
}, function onError(error) {
  console.error(error);
});

About

Turn on/off device screen backlight (go completely dark)

Resources

License

Stars

Watchers

Forks

Packages

No packages published