Skip to content

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)

Notifications You must be signed in to change notification settings

WaseemAliSabeel/lwc-barcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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!


About

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)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published