react-native-passport-id-nfc-reader
v0.0.1
Published
test
Downloads
3
Readme
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