Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gabriel-logan/mobile-native-barcode-generator
Library to generate barcodes and qr codes natively using Kotlin and Swift, integrated with react native.
https://github.com/gabriel-logan/mobile-native-barcode-generator
java kotlin library npm npm-library react react-native react-native-library swift
Last synced: 29 days ago
JSON representation
Library to generate barcodes and qr codes natively using Kotlin and Swift, integrated with react native.
- Host: GitHub
- URL: https://github.com/gabriel-logan/mobile-native-barcode-generator
- Owner: gabriel-logan
- License: mit
- Created: 2024-09-08T07:08:57.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-13T16:10:28.000Z (about 2 months ago)
- Last Synced: 2024-09-27T21:23:05.535Z (about 1 month ago)
- Topics: java, kotlin, library, npm, npm-library, react, react-native, react-native-library, swift
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/mobile-native-barcode-generator
- Size: 2.64 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
> [!NOTE]
> I accept help to make the IOS version.# Mobile Native Barcode Generator
- mobile-native-barcode-generator
[![npm version](https://badge.fury.io/js/mobile-native-barcode-generator.svg)](https://badge.fury.io/js/mobile-native-barcode-generator)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![npm downloads](https://img.shields.io/npm/dm/mobile-native-barcode-generator.svg?style=flat-square)](https://npm-stat.com/charts.html?package=mobile-native-barcode-generator)Library to generate barcodes and qr codes natively using Kotlin and Swift, integrated with react native.
## Supported Frameworks
- React Native - ✅
- Expo GO - ❌ - [See Expo Version](https://github.com/gabriel-logan/expo-barcode)## Supported Architectures
- Android - ✅
- Ios - ❌
- Web - ❌
- Windows - ❌
- Mac - ❌## Installation
```sh
npm install mobile-native-barcode-generator
``````sh
yarn add mobile-native-barcode-generator
```## Usage
### Available methods
```js
import {
BarcodeView,
QRCodeView,
generateBarcode,
generateQRCode,
saveBarcodeToGallery,
saveQRCodeToGallery,
} from "mobile-native-barcode-generator";
```### Using the components
#### Simple example
```js
import { QRCodeView } from "mobile-native-barcode-generator";export default function App() {
return (
);
}const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: "center",
justifyContent: "center",
},
});
``````js
import { BarcodeView, QRCodeView } from "mobile-native-barcode-generator";
import { useState } from "react";
import { StyleSheet, View, Text, TextInput, Button } from "react-native";export default function App() {
const [value, setValue] = useState("");
const [barcodeValue, setBarcodeValue] = useState("");
const [toggleGenCode, setToggleGenCode] = useState("QR");return (
Result:
{barcodeValue &&
(toggleGenCode === "QR" ? (
) : (
))}
setBarcodeValue(value)} />
setToggleGenCode(toggleGenCode === "QR" ? "Barcode" : "QR")
}
/>
);
}const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: "center",
justifyContent: "center",
},
});
```### Using generating functions
```js
import { generateBarcode, generateQRCode } from "mobile-native-barcode-generator";async function waitForIt() {
const qrCodeGenerated = await generateQRCode("Hello", 200, 200);console.log(qrCodeGenerated);
const barCodeGenerated = await generateBarcode("Hello", 300, 200);
console.log(barCodeGenerated);
}waitForIt();
```### Saving generated image to internal gallery
- [README](https://github.com/gabriel-logan/mobile-native-barcode-generator/blob/main/docs/saveToGallery.md)
## Test using Jest
- [README](https://github.com/gabriel-logan/mobile-native-barcode-generator/blob/main/docs/TEST.md)
## Contributing
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
## Contributors
- Gabriel Logan - Creator
## License
MIT
---