Scan QR Code very fast but result is that return empty string, problem with autofocus I guss


I have problem with scan qr code with autofocus I guss, becouse when I try scan qr code by barcode scanner so is too fast and it does’t recognize content of qr code and return empty string. I think that even the camera not enough focus on qr code and barode scanner immediately scan fuzzy qr code and result is empty string.

Sometime the scanner try scanning qr code twice immediately again but anyway barcode scanner return empty string…
I have samsung galaxy S4 mini with 8 Mpx. - android
id=“phonegap-plugin-barcodescanner” version=“4.1.0”

$scope.scanBarcode = function () {
        $ionicPlatform.ready(function () {
            $cordovaBarcodeScanner.scan().then(function (imageData) {
                if (imageData.cancelled) {
                    alert('Please scan again');
                } else {
                    $state.go('app.tabsController.testDetail', { testDetailId: imageData.text });
            }, function (error) {

Is it any way how to improve this code for better recognition of content of qr code? or set autofocus by handle click to display?

I am apologize for my english.

Thank You very much for your response.



I find solution, I must replace on-touch instead of ng-click and its
working, becouse when i use ng-click so sometimes the activity of scan
start twice and scanner scan code twotimes imediately after first scan
and in this case result was empty string.