Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
react-native-nfc-card-reader
Advanced tools
This package is specifically designed to scan credit/debit cards using an Android devices NFC reader and return the card number, expiry and card type.
This package will only work on Android and isn't available for iOS as of 2020 because Apple do not allow 3rd party iPhone apps to use the Core NFC framework.
$ 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
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
<activity android:name="com.jackbayliss.nfcreader.NfcCardReaderActivity"/>
startNfc(callback)
-> Will start the NFC Activity and expects a callback function that will return the card details it's scanned.
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.
You can find the sample app here
I am by no means an Android developer, but saw this as a huge thing no one had produced for React Native. So, if you can expand or improve on my basic implementation feel free to create a pull request.
MIT - expanded from here
A special thanks to pro100svitlo for their library which gave me the ability to create this module. A special thanks to decoder10 for fixing a few issues, and adding firstname / lastname - as well as allowing any NFC cards to be scanned.
FAQs
An NFC reader specifically for credit/debit cards.
We found that react-native-nfc-card-reader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.