Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/datalogic/react-native-datalogic-module
React Native Datalogic Module for Datalogic Android devices
https://github.com/datalogic/react-native-datalogic-module
Last synced: 20 days ago
JSON representation
React Native Datalogic Module for Datalogic Android devices
- Host: GitHub
- URL: https://github.com/datalogic/react-native-datalogic-module
- Owner: datalogic
- Created: 2021-04-16T21:04:07.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-06-21T21:22:54.000Z (over 2 years ago)
- Last Synced: 2023-03-04T15:58:05.133Z (almost 2 years ago)
- Language: Kotlin
- Size: 994 KB
- Stars: 3
- Watchers: 7
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-datalogic-module
Library that exposes the Datalogic Android (Kotlin) SDK as a React Native Module.
## Installation
```sh
yarn add @datalogic/react-native-datalogic-module
OR
npm i @datalogic/react-native-datalogic-module
```## Documentation
[Documentation is available here](https://datalogic.github.io/reactnative).
## Usage
```js
import { BarcodeManager } from "@datalogic/react-native-datalogic-module";
import { NativeEventEmitter, Alert } from 'react-native';
// ...
React.useEffect(() => {
try {
const eventEmitter = new NativeEventEmitter(BarcodeManager);
eventEmitter.addListener('successCallback', (map) => {
Alert.alert('Barcode Result', map.barcodeData + '\n' + map.barcodeType);
});
BarcodeManager.addReadListener();
} catch(e) {
console.error(e);
}
}, []);
```