Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation doesn't work after continuousScanCallback close #242

Open
lvnmdev opened this issue Jun 26, 2020 · 2 comments
Open

Navigation doesn't work after continuousScanCallback close #242

lvnmdev opened this issue Jun 26, 2020 · 2 comments

Comments

@lvnmdev
Copy link

lvnmdev commented Jun 26, 2020

So i used the continousScanCallback, it works but upon pressing back to close the scanner, navigation does not work anymore, modals do but any navigation doesn't.

Here's my code segment.

export function ScanBarcode(args) {
const object = args.object;
const page = object.page;

const barcodescanner = new BarcodeScanner();
const transaction = new Transaction();

const toasty = new Toasty({
    text: 'Barcode Scanned',
    position: 'BOTTOM',
    duration: 'SHORT',
    textColor: '#ebeef7',
    backgroundColor: '#6ce4b9'
});

try {
    barcodescanner.scan({
        formats: "QR_CODE, EAN_13",
        message: "Please align the QR Code / Barcode to scan.",
        showTorchButton: true,
        beepOnScan: true,
        fullScreen: true,
        orientation: "portrait", 
        reportDuplicates: true,
        openSettingsIfPermissionWasPreviouslyDenied: true,
        scanResult: (e) => {console.log(e)},
        continuousScanCallback: (result) => {
            setTimeout(async() => {
                if (result.format === "EAN_13") {
                    await StoredProcedure.execute('order/UpdateOrderBodyStatus.sql', result.text).then(result => {
                        toasty.show();
                    }).catch(err => {
                        console.error(err);
                    })
                }
                else if (result.format === "QR_CODE") {
                    await transaction.AddTransaction(JSON.parse(result.text)).then(() => {
                        barcodescanner.stop();
                    }).catch(err => {
                        console.error(err);
                    });
                }
            }, 100);
        },
        closeCallback: () => {
            console.log("Scanner closed")
            barcodescanner.stop();
        },
    }).then(
        result => {
            console.log('then', result);
        },
        errorMessage => { 
            console.log("No scan. " + errorMessage);
        }
    );
} catch (err) {
    console.error(err);
}

}

@domzinhuu
Copy link

Me too, but this problem appears with no continuousScanCallback too.

Version:
"@angular/animations": "~10.0.0",
"@angular/common": "~10.0.0",
"@angular/compiler": "~10.0.0",
"@angular/core": "~10.0.0",
"@angular/forms": "~10.0.0",
"@angular/platform-browser": "~10.0.0",
"@angular/platform-browser-dynamic": "~10.0.0",
"@angular/router": "~10.0.0",
"@nativescript/angular": "~10.0.0",
"@nativescript/core": "rc",
"@nativescript/theme": "^2.3.3",
"@nstudio/nativescript-floatingactionbutton": "^2.1.0",
"core-js": "^2.6.9",
"nativescript-barcodescanner": "^3.4.2",
"nativescript-toast": "^2.0.0",
"reflect-metadata": "~0.1.12",
"rxjs": "~6.5.5",
"tslib": "1.10.0",
"zone.js": "~0.10.2"

DevDependencies:
"@angular/cli": "~10.0.0",
"@angular/compiler-cli": "~10.0.0",
"@angular-devkit/build-angular": "~0.1000.2",
"@nativescript/tslint-rules": "~0.0.5",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^5.1.2",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.4.1",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~3.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"@nativescript/webpack": "~2.0.0",
"protractor": "~5.4.3",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~3.9.0",
"node-sass": "^4.7.1"

@j99ht
Copy link

j99ht commented Oct 29, 2021

Does anyone have a solution for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants