Hi All, I want to turn flashlight on automatically (if possible) or manually (on and off) when starting scanning barcode. But I am even unable to just use the “Flashlight” plugin in ionic4, It is showing the “Object(…) is not a function” when calling any of the flashlight function such as this.flashlight.switchOn( ) etc. Error screenshot can be shown below:
import { Flashlight } from ‘@ionic-native/flashlight/ngx’;
providers: [Flashlight]
CreateListing.ts:
import { Flashlight } from ‘@ionic-native/flashlight/ngx’;
class CreateListingPage {
constructor (private flashlight: Flashlight) {
}
turnOnFlash() {
this.flashlight.available(); // throws error as show in the question
this.flashlight.switchOn(); // throws the same error
// in same way, whatever function I am calling on this.flashlight instance throwing error
}