capacitor-flash

Switch the Flashlight / Torch of your device.

Install

npm install capacitor-flash
npx cap sync

API

isAvailable()

isAvailable() => any

Checks if flashlight is available

Returns: any


switchOn(...)

switchOn(options: { intensity?: number; }) => any

Turns the flashlight on

Param Type
options { intensity?: number; }

Returns: any


switchOff()

switchOff() => any

Turns the flashlight off

Returns: any


isSwitchedOn()

isSwitchedOn() => any

Checks if the flashlight is turned on or off

Returns: any