BlinkID / blinkid-cordova

ID scanning for cross-platform apps built with Cordova and Phonegap.
48 stars 34 forks source link

Barcode is not working #93

Closed jdixosnd closed 5 years ago

jdixosnd commented 5 years ago

I am trying to integrate barcode along with other card types, all other card recognizers are working fine except BarcodeRecognizer, Following is the sample code,

var recognizer  = new (<any>window).cordova.plugins.BlinkID.BarcodeRecognizer();  
var SuccessFrameGrabber = new (<any>window).cordova.plugins.BlinkID.SuccessFrameGrabberRecognizer(recognizer);              
var barcodeOverlaySettings = new (<any>window).cordova.plugins.BlinkID.BarcodeOverlaySettings();
var recognizerCollection = new (<any>window).cordova.plugins.BlinkID.RecognizerCollection([SuccessFrameGrabber]);
(<any>window).cordova.plugins.BlinkID.scanWithCamera(
    function callback(cancelled) {
        // handle cancelled scanning
        if (cancelled) {
            console.log("is cancelled!!");
            return;
        }
        console.log(recognizer.result);
    },
    function errorHandler(err) {
         console.log(err);
    },barcodeOverlaySettings, recognizerCollection, licenseKeys );

Please help !

jcular commented 5 years ago

Hi @jdixosnd,

you need to set the barcode type you want to scan, by default all barcode types are set to false. See available barcode types here just set the property of the barcode type you want to scan to true on your instance.

Kind regards, Jure

jdixosnd commented 5 years ago

thank you for quick response Jure.