A barcode generator for react-native
npm install react-native-barcodeGenerate barcodes using iOS Core Image filters.
Currently supports:
- Aztec
- QR
1. Run npm install react-native-barcode --save
2. Open your project in XCode, right click on Libraries and click AddlibLFAztecCode.a
Files to "Your Project Name" (Screenshot).
3. Add to Build Phases -> Link Binary With LibrariesLFAztecCode.xcodeproj
(Screenshot).
4. Click on in Libraries and go the Build
Phases tab. Double click the text to the right of Header Search
Paths and verify that it has $(SRCROOT)../../../react-native/React - if itLFAztecCode
isn't, then add it. This is so XCode is able to find the headers that
the source files are referring to by pointing to thereact-native
header files installed within the node_modules
directory. (Screenshot).
5. Compile and enjoy!
`javascript
var AztecCode = require('react-native-barcode').AztecCode;
class AztecCodeExample extends React.Component{
render() {
return (
);
}
}
var styles = StyleSheet.create({
code: {
height: 200,
width: 200,
},
});
``
Use
Right now there is only support for the inputMessage property of the filter, which is renamed to the prop "content"
##TODO
- Add support for more props
- Add more barcode types
- Scale the image off the main thread?