Credit Card Scanning in React Native

— 2 minute read

I'm happy to announce my first react-native package; You can view the project on GitHub, there is also an Example iOS Project to get you started. Android support is planned, if you'd like to help me implement it, shoot me an email on or create a PR. adds javascript bindings for an open-source project created by PayPal and used by Uber, TaskRabbit and GrubHub amongst others.

Using the Card Scanner permalink

Install the cli tool for initialising react-native projects

npm i react-native-cli -g

Run the react-native setup

react-native init CardWallet && cd CardWallet

Once this is complete we can remove the android code folder as we're not going to be using it.

rm -rf android

At this point you should open the project in XCode and test that it builds ok

From within the project folder you should run:

npm i --save

Because contains native code, we need to add it to our XCode project.

Right click on the project and "Add files to ..." Add Files to Project

Navigate to your node_modules folder and select the project. Select the XCode Project

Add the binary to the Link build step Select the Binary

Add the -lc++ flag to "Other Linker Flags" Add linker flags

Require the component in your view

import CardIO from "";

Add it to your render method, don't forget to handle the onSuccess and onFailure callbacks.

onSuccess={(cardInfo) => console.log(cardInfo)}
onFailure={(err) => console.error(err)}

Thats it!