0.12.12 • Published 9 months ago

react-native-lecom-scan v0.12.12

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

react-native-lecom-scan

React Native implementation of the Lecom scanner SDK. Tested with Lecom T80 and N60 scanners.

Current native Lecom SDK version: 2.2.1

Installation

npm install react-native-lecom-scan

# or

yarn add react-native-lecom-scan

# or

expo install react-native-lecom-scan

Usage

import { useLecomScan, toggleScan } from 'react-native-lecom-scan';

const MyComponent = () => {
  const { code, isDevice } = useLecomScan({
    callback: (scannedCode) => {
      console.log('Scanned Code:', scannedCode);
    },
    isActive: true,
  });

  return (
    <View>
      {isDevice ? (
        <Text>Scanned Code: {code}</Text>
      ) : (
        <Text>Lecom Scanner is not available on this device.</Text>
      )}
      <Button title="Toggle Scan" onPress={toggleScan} />
  </View>
);

export default MyComponent;

API

useLecomScan(options: LecomScanOptions): LecomHook

Hook to use the Lecom scanner.

Options (optional)

OptionTypeDescription
callbackfunctionA function that gets called with the scanned code.
isActivebooleanBoolean to control if the scanner should be active (default: true).
modelstringOptional custom model name override.

model - The library was tested with T80 and N60 models. If you have a different model, you can pass the model name as a string to the model option. The model name for your device can be obtained from the react-native's Platform module.

import { Platform } from 'react-native';

console.log(Platform.constants.Brand);

toggleScan(): void

Function to toggle the scanning state programmatically.

Contributing

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

License

MIT

0.12.10

9 months ago

0.12.11

9 months ago

0.12.7

9 months ago

0.12.8

9 months ago

0.12.9

9 months ago

0.12.1

9 months ago

0.12.2

9 months ago

0.12.12

9 months ago

0.12.3

9 months ago

0.12.4

9 months ago

0.12.5

9 months ago

0.12.6

9 months ago

0.11.0

1 year ago

0.10.1

1 year ago

0.11.1

1 year ago

0.11.2

1 year ago

0.11.3

1 year ago

0.11.4

1 year ago

0.11.5

1 year ago

0.10.0

3 years ago

0.9.0

3 years ago

0.8.0

3 years ago

0.7.0

3 years ago

0.6.0

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago