Ionic native plugin does not work(barcode scanner, camera)


#1

Hi.

Suddenly camera and barcode scanner module doesn’t work.
I can’t call this module after build. Only previous file is ok.

Please help me.

Here is my code.


  BarcodeScanner.scan().then((barcodeData) => {
    if (barcodeData.cancelled) {
      console.log("User cancelled the action!");
      //this.buttonText = "Scan";
      //this.loading = false;
      return false;
    }
    console.log("Scanned successfully!");
    console.log(barcodeData);
    this.jobno = barcodeData.text.trim();
    this.samno_str(this.samno);
  }, (err) => {
    console.log(err);
  });

#2

I doubt it was sudden. You changed from ionic-native v2 to v3, yes? So when you do such things, always carefully read the documentation and make sure your usage matches it.


#3

I found Ionic view is ok but I can’t open camera on the device.(ionic run ios)
Do you know why?


#4

I can’t go into the function below.
There are no errors and no responses.

BarcodeScanner.scan().then((barcodeData) => {
if (barcodeData.cancelled) {
return false;
}
}, (err) => {
console.log(err);
});


#5

Sorry, I had changed xcode config file…
I solved this issue.

Thanks.


#6

Could you tell me what you had to change? I can’t get the barcode scanner to work on iOS (it works perfectly on Android). I’ve already updated the Info to put the description for it using the camera. Am I missing something?