I'm creating a react native (version 0.62.2) app for iOS and Android, and I would like the user to be able to use the camera on their phone to scan their credit/debit card to use for payment. I am using the react-native-awesome-card-io library, and I used the simple example found in the library's Github readme here. I ran the app on my iPhone XR (iOS 13), and everything seems to work fine, except it can't seem to get the information (i.e., credit card number, expiration date, name) from the card. I haven't been able to test on Android because I do not have an Android device (and it does not work on the emulator).
As described on the library's readme, there are three options for scanning the card:
- IMAGE_AND_NUMBER (CardIODetectionModeCardImageAndNumber) - the scanner must successfully identify the card number.
- IMAGE (CardIODetectionModeCardImageOnly) - don't scan the card, just detect a credit-card-shaped card.
- AUTOMATIC (CardIODetectionModeAutomatic) - start as CardIODetectionModeCardImageAndNumber, but fall back to CardIODetectionModeCardImageOnly if scanning has not succeeded within a reasonable time.
Just using IMAGE works normally, but if I use IMAGE_AND_NUMBER, it just stalls, and if I use AUTOMATIC, it defaults after a while to IMAGE. In other words, it can detect the card and take a picture of it, but it can't seem to actually read any of the information on the card.
It seems that this issue might not be with react-native-awesome-card-io, but with the SDKs that this library is a wrapper for. Unfortunately, both the iOS card.io SDK and Android card.io SDK are archived. There is an existing issue on the card.io-iOS-SDK from over a year ago that seems to ask the same question I have, but there have been no responses. There is also a similar unresolved issue on react-native-awesome-card-io, but no solution.
There are a couple of other react-native libraries that wrap the card.io SDKs, but I couldn't find any except for react-native-awesome-card-io that have had any maintainence for the past two years. I suspect that my problem is an issue with the card.io SDKs, which would therefore affect all the wrappers for these components.
Does anybody know any potential fixes for this, or better yet, another (currently maintained) option besides card.io for scanning credit cards with the camera with react native?