Closed fabiokounang closed 1 year ago
Hello, all is good except when i open the camera and then instantly go back, it wont go back, it kept still being in the camera. Please help
my script is
async onPermissionCamera () { const status = await BarcodeScanner.checkPermission({ force: true }); return status; } async onOpenCamera () { const ionApp = document.querySelector('ion-app'); try { if (await this.onPermissionCamera()) { ionApp.classList.add('scanner-ui'); BarcodeScanner.hideBackground(); const result = await BarcodeScanner.startScan(); console.log(result, 'result') if (result && result.hasContent) { this.router.navigate(['/event', result.content]); ionApp.classList.remove('scanner-ui'); ionApp.style.display = 'block'; } else { console.log('masuk else'); BarcodeScanner.showBackground(); BarcodeScanner.stopScan(); ionApp.classList.remove('scanner-ui'); ionApp.style.display = 'block'; } } } catch (error) { console.log(error, 'error'); BarcodeScanner.showBackground(); BarcodeScanner.stopScan(); ionApp.classList.remove('scanner-ui'); ionApp.style.display = 'block'; } }
the scanner-ui class is .scanner-ui { display: none; }
.scanner-ui { display: none; }
I think i am mistaken. This is not a bug, but I have to handle back button from android myself https://ionicframework.com/docs/developing/hardware-back-button
Hello, all is good except when i open the camera and then instantly go back, it wont go back, it kept still being in the camera. Please help
my script is
the scanner-ui class is
.scanner-ui { display: none; }