An NFC reader specifically for credit/debit cards.
npm install react-native-nfc-card-reader$ npm install react-native-nfc-card-reader --save
npm install "https://github.com/jackbayliss/react-native-nfc-card-reader.git#gradle7.0" --save
$ react-native link react-native-nfc-card-reader
javascript
import NfcCardReader from 'react-native-nfc-card-reader';
NfcCardReader.startNfc(function(cardDetails){
// Card details contain the callback data below, see the options.
that.setState({cardNumber : cardDetails.cardNumber})
that.setState({expiryDate : cardDetails.expiryDate})
that.setState({cardType : cardDetails.cardType})
})
`
Ensure you add the following to your AndroidManifest.xml located in android\app\src\main
`
`
Methods
startNfc(callback) -> Will start the NFC Activity and expects a callback function that will return the card details it's scanned.
$3
cardType -> Provides the type of the card scanned.
cardNumber -> Provides the full card number scanned.
expiryDate -> Providers the expiry date of the card scanned.
firstName -> Card owners first name.
lastName` -> Card owners last name.