Skip to content

Component to scan a driver's license barcode #23

@cormander

Description

@cormander

As a canvasser I want to be able to scan a driver's license barcode so that data from it can be used to pre-fill fields or be used to verify information so we can implement features such as easy voter registration and voter record validation.

This feature is done when:

  • A data type of something name like "id scan" exists and when selected, opens the camera and scans for a driver's license barcode
  • The data from the barcode is available to be consumed by a callback function.

Proof-of-concept code uses these libraries:

import { RNCamera } from 'react-native-camera';
import { parse } from 'parse-usdl';

And references the components to capture / parse data like so:

  <RNCamera
    ref={ref => {this.camera = ref;}}
    style={{
      flex: 1,
      justifyContent: 'space-between',
    }}
    androidCameraPermissionOptions={{
      title: 'Permission to use camera',
      message: 'We need your permission to use your camera',
      buttonPositive: 'Ok',
      buttonNegative: 'Cancel',
    }}
    onBarCodeRead={(e) => console.warn(parse(e.data))}
    barCodeTypes={[RNCamera.Constants.BarCodeType.pdf417]}
  >

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions