
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
react-native-scanzy-barcode-scanner-plugin
Advanced tools
Scanzy barcode scanner plugin for React Native platform
react-native-scanzy-barcode-scanner-plugin implements the barcode capture capabilities of the ScanzyBarcodeScannerSDK for iOS and Android. It supports reading a large number of different barcode symbologies, such as Code39, Code93, Code128, Codabar, UPC-A, UPC-E, EAN-8, EAN-13, ITF, QRCode, Aztec, PDF-417, Data Matrix, etc.
Learn more with the documentation or get started with sample
npm install react-native-scanzy-barcode-scanner-plugin
For ios project, in order to get camera permission, please add below configs to the Info.plist of the Project Targets.
<key>NSCameraUsageDescription</key>
<string>camera description.</string>
For android project, add the following config in the same build.gradle(Android/app/build.gradle) file to avoid conflicts with the lib filename libc++_shared.so, which is used by React Native as well as by many other 3rd-party modules:
android {
...
packagingOptions {
pickFirst '**/libc++_shared.so'
}
}
import ScanzyBarcodeManager, {ScanzyBarcodeFormat, ScanzyBarcodeOptions} from 'react-native-scanzy-barcode-scanner-plugin';
//set lisense in your app init function
ScanzyBarcodeManager.setLicense('YOUR LICENSE KEY');
//set scan formats and options
const formats = [ScanzyBarcodeFormat.Code128, ScanzyBarcodeFormat.Code93, ScanzyBarcodeFormat.EAN13, ScanzyBarcodeFormat.QRCode];
const options: ScanzyBarcodeOptions = {
enableVibration: true,
enableBeep: true,
enableAutoZoom: false,
enableScanCropRectOnly: false,
formats: formats
}
// scan
ScanzyBarcodeManager.scan(options).then((result: ScanzyBarcodeScanResult)=>{
//get the scan result
console.log('Scan Result:', result.barcode, result.barcodeType)
})
Below gives you more details about the parameters:
The definition of ScanzyBarcodeFormat:
const ScanzyBarcodeFormat = {
Code128:"Code128",
Code39:"Code39",
Code93:"Code93",
CodaBar:"CodaBar",
DataMatrix:"DataMatrix",
EAN13:"EAN13",
EAN8:"EAN8",
ITF:"ITF",
QRCode:"QRCode",
UPCA:"UPCA",
UPCE:"UPCE",
PDF417:"PDF417",
Aztec:"Aztec",
MaxiCode:"MaxiCode"
}
Note: to set the formats you only interested, although you can add ALL formats, it definitely would impact the performance.
The ScanzyBarcodeOptions is defined as:
interface ScanzyBarcodeOptions {
enableVibration?: boolean;
enableBeep?: boolean;
enableAutoZoom?: boolean;
enableScanCropRectOnly?: boolean;
formats?: string[];
}
enableVibration: vibrate your phone when barcode detected.
enableBeep: play the beep sound when barcode detected.
enableAutoZoom: the library will zoom in/out automatcially to scan the barcode.
enableScanCropRectOnly: only scan the view finder area.
formats: the barcode formats.
The ScanzyBarcodeScanResult is defined as:
interface ScanzyBarcodeScanResult {
barcode: string;
barcodeType: string;
}
if you have any questions or need help, check out our official website. Get a free trial license to try. It won't take more than one hour to integrate, insanely simple!
FAQs
Scanzy barcode scanner plugin for React Native platform
We found that react-native-scanzy-barcode-scanner-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.