New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-zxing-generator

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-zxing-generator

A react native component to generate barcode.

  • 0.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
12
Maintainers
1
Weekly downloads
 
Created
Source

react-native-zxing

A react native component to generate barcode.

install

  • Pending to be published npm install react-native-zxing --save

iOS manual setup

  • Open your project workspace in xcode
  • Add node_modules/Zxing/ios/Zxing.xcodeproj/project.pbxproj to Libraries
  • Add node_modules/Zxing/ios/Carthage/Build/iOS/ZXingObjC.framework to frameworks
  • In Build Phases -> Link Binary With Libraries, Link the libZxing.a available in Libraries/Zxing.xcodeproj/Products folder
  • In Build Settings -> Search Paths -> Framework Search Paths, add $(SRCROOT)/../node_modules/react-native-zxing/ios/Carthage with recursive option
  • On Project target -> General -> Embedded Binaries, Add ZXingObjC.framework

Android manual setup

  • Open settings.gradle in the android application and reference to Zxing node module as shown below
include ':react-native-zxing'
project(':react-native-zxing').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-zxing/android')
  • Add ZXing and react-native-zxing to dependecies in build.gradle of the app
dependencies {
    compile project(':react-native-zxing')
    // https://mvnrepository.com/artifact/com.google.zxing/core
    compile group: 'com.google.zxing', name: 'core', version: '3.3.0'
  • Add ZxingPackage to react native package
import com.hariharanweb.xzing.ZxingPackage;

protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
        ...
        new ZxingPackage()
    );
}

Usage

import Zxing from 'Zxing'

class BarcodeComponent extends Component {

    render() {
        return (
            <View>
                <Zxing text="Text to be embedded in barcode"
                    format="AZTEC"
                    style={{height: 200 width: 200}}/>
            </View>)
    }
}

Props

NameDescriptionDefaultType
texttext to be encoded in barcode - requirednonestring
formatFormat of the barcode - required-'AZTEC', 'CODABAR', 'CODE_39', 'CODE_93','CODE_128', 'DATA_MATRIX', 'EAN_8','EAN_13', 'ITF', 'MAXICODE', 'PDF_417','QR_CODE', 'RSS_14', 'RSS_EXPANDED', 'UPC_A', 'UPC_E', 'UPC_EAN_EXTENSION'
widthwidth of barcode200int
heightheight of barcode200int

Custom styling

- Height and Width can be controlled from style props, same as View.propTypes.style.

P.S

Thanks to the react native community. PRs welcome.

License

MIT

Keywords

FAQs

Package last updated on 14 Jan 2020

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