Need help upgrading to Ionic Framework 4.0? Get assistance with our Enterprise Migration Services EXPLORE NOW

Backlightβ

Improve this doc

This plugin is still in beta stage and may not work as expected. Please submit any issues to the plugin repo.

This plugin adds turning on/off the device backlight.

Repo: https://github.com/mebibou/cordova-plugin-backlight

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add cordova-plugin-backlight
    $ npm install --save @ionic-native/backlight@4
    
  2. Add this plugin to your app's module

Supported platforms

Usage

import { Backlight } from '@ionic-native/backlight';

constructor(private backlight: Backlight) { }

...

// Turn backlight on
this.backlight.on().then(() => console.log('backlight on'));

// Turn backlight off
this.backlight.off().then(() => console.log('backlight off'));

Instance Members

on()

This function turns backlight on

Returns: Promise<any> Returns a promise that resolves when the backlight is on

off()

This function turns backlight off

Returns: Promise<any> Returns a promise that resolves when the backlight is off

API

Native

General