# react-native-zepra-scanner-1

> react-native-zepra-scanner

Latest version **1.0.5** (published 2023-12-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-zepra-scanner-1
pnpm add react-native-zepra-scanner-1
yarn add react-native-zepra-scanner-1
bun add react-native-zepra-scanner-1
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2023-12-20 |
| First published | 2023-12-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 496.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | HT |
| Maintainers | hamedtaheri32 |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/react-native-zepra-scanner-1
- Repository: https://github.com/intellidev1991/react-native-zippra-scanner
- Homepage: https://github.com/intellidev1991/react-native-zippra-scanner#readme
- Issues: https://github.com/intellidev1991/react-native-zippra-scanner/issues
- npm.io page: https://npm.io/package/react-native-zepra-scanner-1

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2023-12-20
- 1.0.4 — 2023-12-20
- 1.0.3 — 2023-12-20
- 1.0.2 — 2023-12-20
- 1.0.1 — 2023-12-20

## README

# react-native-zippra-scanner

Zebra scanner for react native ("https://www.zebra.com/us/en/support-downloads/software/developer-tools/scanner-sdk-for-android.html")

## Installation

```sh
npm react-native-zepra-scanner-1

npx expo install react-native-zepra-scanner-1
```

## Usage

```js
import * as React from 'react';

import {
  StyleSheet,
  View,
  Button,
  DeviceEventEmitter,
  Text,
} from 'react-native';
import {
  findCabledScanner,
  findBluetoothScanner,
  requestBluethoothAccess,
  setupApi,
  getActiveScannersList,
  Listeners,
} from 'react-native-zepra-scanner-1';

export default function App() {
  const [code, setCode] = React.useState('');

  React.useEffect(() => {
    requestBluethoothAccess().then(setupApi);

    DeviceEventEmitter.addListener(Listeners.SCANNER_DISAPPEARED, () =>
      console.log('SCANNER_DISAPPEARED')
    );
    DeviceEventEmitter.addListener(Listeners.SCANNER_ESTABLISHED, () =>
      console.log('SCANNER_ESTABLISHED')
    );
    DeviceEventEmitter.addListener(Listeners.SESSION_TERMINATED, () =>
      console.log('SESSION_TERMINATED')
    );
    DeviceEventEmitter.addListener(
      Listeners.BARCODE_RECEIVED,
      (value: string) => setCode(value)
    );
  }, []);

  const getDevices = () => {
    getActiveScannersList().then((devices) => {
      console.log(JSON.stringify(devices));
    });
  };

  return (
    <View style={styles.container}>
      <Text>Result: {code}</Text>
      <Button
        style={styles.openButton}
        onPress={() => findBluetoothScanner('A4:C7:4B:3B:38:F5')}
        title={'Open bluetooth barcode'}
      />
      <Button
        style={styles.openButton}
        onPress={findCabledScanner}
        title={'Open usb barcode'}
      />
      <Button
        style={styles.openButton}
        onPress={getDevices}
        title={'Get Devices'}
      />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'space-around',
  },
  openButton: {
    width: 120,
    height: 60,
    backgroundColor: '#000000',
  },
});
```

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

---

Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)

---
_Source: https://npm.io/package/react-native-zepra-scanner-1 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
