The Salesforce Developers website will undergo maintenance on May 29, 2024 from 3:00 a.m. UTC to 10:00 a.m. UTC. The maintenance process may affect the availability of our documentation. Please plan accordingly.

endCapture() (Legacy)

Use this function to end a scanning session, close the mobile OS scanning interface, and dispose of resources.

We recommend using the modern scan() and dismiss() APIs in your LWC’s scanning code to streamline your development experience. The legacy APIs beginCapture(), resumeCapture(), and endCapture() are still available, but will be retired in a future release.



After calling endCapture(), you can call beginCapture() on an existing or new BarcodeScanner instance to start a new scanning session.

See Also