Develop Secure Code
BarcodeScanner Constants
BarcodeScanner Data Types
getBarcodeScanner()
isAvailable()
scan(options)
dismiss()
beginCapture(options) (Legacy)
resumeCapture() (Legacy)
endCapture() (Legacy)
dismiss()Use this function to end a scanning session, close the mobile OS scanning interface, and dispose of resources.
1import { getBarcodeScanner } from 'lightning/mobileCapabilities';
2dismiss(): voidNone.
None.
1myScanner
2 .scan(scanningOptions)
3 .then((result) => {
4 console.log(result);
5 this.scannedBarcode = result.value;
6 })
7 .catch((error) => {
8 console.error(error);
9 })
10 .finally(() => {
11 // Handle final cleanup
12 myScanner.dismiss();
13 });After calling dismiss(), you can call scan() on an existing or new BarcodeScanner instance to start a new scanning session.