BarcodeScanner icon indicating copy to clipboard operation
BarcodeScanner copied to clipboard

Barcode scanner doesn't go to scanning sometimes

Open RezaRahmati opened this issue 10 years ago • 4 comments

Hi I have used the barcode scanner in a cordova application, the problem is sometimes calling cordova.plugins.barcodeScanner.scan(...) method doesn't go to scanning process, it won't show the camera image and it doesn't do anything. I just want to know if this is a known issue or is it related to anything on the phone? (p.s. I have restarted the phone, clean the memory, android 4.2.4)

RezaRahmati avatar Jun 04 '15 11:06 RezaRahmati

The same problem here. The promise returns success with an object that the object.cancelled is equal true.
code image
console.log image

lourenci avatar Aug 03 '15 23:08 lourenci

@lourenci the same for me,could you tell me how did it?

ChenJerome avatar Jan 29 '16 09:01 ChenJerome

@ChenJerome, I gave up Cordova. 😐 I am coding in native language. Good luck!

lourenci avatar Jan 29 '16 10:01 lourenci

@lourenci thank you so much~~~~(>_<)~~~~

ChenJerome avatar Feb 01 '16 02:02 ChenJerome

@lourenci i solved it yesterday.the code like this: $scope.scanBarcode = function(){ //alert("With this alert, the scan is useful"); $timeout(function(){ cordova.plugins.barcodeScanner.scan( function (result) { alert("We got a barcode\n" + "Result: " + result.text + "\n" + "Format: " + result.format + "\n" + "Cancelled: " + result.cancelled); }, function (error) { alert("Scanning failed: " + error); } ); },500); }; hope useful.

ChenJerome avatar Feb 02 '16 02:02 ChenJerome

use on-touch="action()" not ng-click="action()"

vene01 avatar Feb 29 '16 05:02 vene01