Ionic Flashlight Plugin Doesn't Work Properly On iOs

I’m having trouble with the ionic flashlight plugin for Cordova on iOS, it works fine on android.

If I create a button and do the following simple switch off:

console.log(“TURNED OFF”)

The promise comes back fine and it logs TURNED OFF. The problem is it doesn’t turn the flashlight off on my iPhone if I turned it on via the phone pull down menu.

If I create a button in the app and do:

console.log(“TURNED ON”)

This turns the torch on, and the off button turns it off, it’s when I turn the light on via the pull down menu then press the off button in the app, nothing happens (the light does not turn off). It’s almost as though the built in button on the iPhone uses a different way to turn the torch on and off.

In fact I also noticed that if I turn the torch on via the app the actual torch button on my phone becomes disabled, it’s like it’s using totally different methods.

For plugin problems you better ask at the github plugin page.
But to switch on/off you better first check the flashlight status like it is described at the github page.

window.plugins.flashlight.isSwitchedOn(); // returns true/false

Yes we do, but that always returns false when the torch has been turned on vis the control centre