Skip to content

Latest commit

 

History

History
51 lines (31 loc) · 2 KB

README.md

File metadata and controls

51 lines (31 loc) · 2 KB

lwc-barcode

Salesforce LWC to Scan barcodes using mobile camera (Only Mobile Salesforce App) as well as to Create a QR Code for any content. (Desktop & Mobile)


Highlights

Salesforce had released a new BarcodeScanner API which supports barcode scanning natively on LWC for mobile devices using the Salesforce Mobile App. Since it’s supported natively, we don’t need to worry about maintaining 3rd party Javascript, Locker services, performance issues, etc.

This Salesforce LWC Component contains methods to Scan any of the Supported Bar Codes by Salesforce and also provides an ability via JavaScript file to Create a QR Code out of user-entered string content. QR Code Generation can be done on Desktop or Mobile experience whereas the Bar Code scanning works in Salesforce Mobile App only.

For Scanning Bar Codes, steps involved are-

  • import getBarcodeScanner from lightning/mobileCapabilities
  • initiate scanner variable using method getBarcodeScanner()
  • set configuration suggesting which supported barcodes are needed to scan
  • use begineCapture() method for launching mobile camera
  • read the scanned result or handle error accordingly, concluding with endCapture()

App Example Screenshots

Mobile View =

Desktop View =

Scanned Examples on Mobile =


Author


Support

Reach out at one of the following places!