Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rn-barcode-zxing

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rn-barcode-zxing

rn-barcode-zxing

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
90
increased by3.45%
Maintainers
0
Weekly downloads
 
Created
Source

rn-barcode-zxing

img

Installation

npm install rn-barcode-zxing react-native-vision-camera lottie-react-native lottie-ios
yarn add rn-barcode-zxing react-native-vision-camera lottie-react-native lottie-ios

Android

Inside your gradle.properties file, add the enableCodeScanner flag:

VisionCamera_enableCodeScanner=true
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />

IOS info.plist

  <key>NSCameraUsageDescription</key>
  <string>Use the built-in Camera to scan any QR code</string>

Usage

import { ScanCode } from 'rn-barcode-zxing';

<SafeAreaView style={[{ flex: 1 }, backgroundStyle]}>
  <StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
  <View style={{ flex: 1 }}>
    <ScanCode onScanBarcode={(ScanBarcode) => console.log({ ScanBarcode })} />
  </View>
</SafeAreaView>;
  • react-native-barcode-mask
import { BarcodeScanner } from 'rn-barcode-zxing';
import BarcodeMask from 'react-native-barcode-mask';

<View style={[styles.content, StyleSheet.flatten(contentStyle)]}>
  <BarcodeScanner
    style={[styles.cameraStyle, StyleSheet.flatten(cameraStyle)]}
    shouldScan={true}
    onBarcodesDetected={onScanBarcode}
  >
    <BarcodeMask
      width={300}
      height={300}
      showAnimatedLine={true}
      outerMaskOpacity={0.8}
      edgeHeight={48}
      edgeWidth={48}
      animatedLineColor={'#FFFFFF'}
      animatedLineHeight={3}
      backgroundColor={'rgba(3, 3, 3, 0.3)'}
      animatedLineWidth={204}
      lineAnimationDuration={2000}
    />
  </BarcodeScanner>
</View>;

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Keywords

FAQs

Package last updated on 26 Sep 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc