react-native-passport-id-nfc-reader
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

react-native-passport-id-nfc-reader

React native allows you to scan using nfc for ID and passport only on ios platform.

Installation

npm install react-native-passport-id-nfc-reader

Usage

 import * as React from 'react';

import {
  NFCPassportModel,
  scanPassport,
} from 'react-native-passport-id-nfc-reader';
import { Alert, Button, StyleSheet, View } from 'react-native';

export default function App() {
  const [_, setResult] = React.useState<NFCPassportModel>();

  const scanDocument = () => {
    scanPassport({
      birthDate: '1993-04-10T00:00:00Z',
      expiryDate: '2030-08-19T00:00:00Z',
      passportNumber: 'A28L66104',
      useNewVerificationMethod: true,
    }).then((res) => {
      if ('error' in res) {
        Alert.alert('NFC failed!', res.error);
        return;
      }
      setResult(res);
    });
  };

  return (
    <View style={styles.container}>
      <Button onPress={scanDocument} title="Start scanning" />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
    backgroundColor: 'white',
  },
});



// ...

Contributing

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

License

MIT


Made with create-react-native-library

Package Sidebar

Install

npm i react-native-passport-id-nfc-reader

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

433 kB

Total Files

104

Last publish

Collaborators

  • gunesiliksiz