card.io-Android-SDK
card.io-Android-SDK copied to clipboard
Can't recognize expiry date
Card.IO ver. 5.3.0 can't recognize expire date.
Intent scanIntent = new Intent(this, CardIOActivity.class); scanIntent.putExtra(CardIOActivity.EXTRA_SUPPRESS_MANUAL_ENTRY, true); scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, true); startActivityForResult(scanIntent, CreditCardActivity.SCAN_CARD_REQUEST_CODE)
Both card number and the expire date of the same card can be successfully recognized in the Uber app (which use Card.IO for card recognition).
Are you testing using the most recent sample app? Have you tried compiling a release version, and/or with proguard? Nothing has changed wrt expiry scanning since the release that Uber is using.
I've been testing on the latest sample app (checked it out yesterday from the repo). Also i tried both release and debug with proguard enabled/disabled.
During debugging i found that expiry is empty after calling native code:
/** pika **/
nScanFrame(data, mPreviewWidth, mPreviewHeight, mFrameOrientation, dInfo, detectedBitmap, mScanExpiry);
It could be that the iOS native code performs better than Android, but I couldn't be sure without some investigation. Have you tried building the source and enabling debugging?
I tried to debug sample app and found that native code doesn't return us expiry date. (see my prev. comment). I'm not very familiar with C/C++ thus i can't properly debug native code for sure.
Looks like expiry scanning is working only when you set the following extras in the below order:
scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, true); scanIntent.putExtra(CardIOActivity.EXTRA_SCAN_EXPIRY, true);
When I've set these extras in the above order sometimes it was reading the expiry date. Otherwise it was not reading the expiry date at all.
I've also tried the iOS SDK and it performed much better than the Android one, both at expiry scanning and card scanning.
The expiry should scan without EXTRA_SCAN_EXPIRY, as the default of that extra is true. Are you saying this is not the case?
As for iOS vs. Android, we haven't done detailed analysis into the differences in platforms, so there's probably some OS-level optimization that could be done.
Initially I had only scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, true); set in the app but it was never reading the expiry date. After adding scanIntent.putExtra(CardIOActivity.EXTRA_SCAN_EXPIRY, true); it started to read sometimes the expiry date.
I've also noticed that on some devices I am not able at all to read the expiry date. For example on a Samsung Galaxy S4 and Samsung Galaxy S6 it is reading the expiry date, but on a Galaxy Note 5 it's never reading. I've tested this with the same CC that I was able to fully read on S4 and S6, but not on Note 5.
@cczank I think the order of extras listed above doesn't make sense because inside of the Card.io library the order of getting extras from intent isn't changing. Also on GS4 5.0.1 i wasn't able to read expiry date.
Might it be dependent on processor on the phone?
Agreed that it doesn't make sense. The extra's default value is true when reading from the extras. It could be that some versions are reading this incorrectly, and that we should not rely on that mechanism.
Hi braebot , I Am using the below code and i am unable to get the expiry date. scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, true); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_SCAN_EXPIRY, true); scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_CVV, false); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_POSTAL_CODE, false); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_RESTRICT_POSTAL_CODE_TO_NUMERIC_ONLY, false); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_CARDHOLDER_NAME, false); // default: false
// hides the manual entry button
// if set, developers should provide their own manual entry mechanism in the app
scanIntent.putExtra(CardIOActivity.EXTRA_SUPPRESS_MANUAL_ENTRY, false); // default: false
// matches the theme of your application
scanIntent.putExtra(CardIOActivity.EXTRA_KEEP_APPLICATION_THEME, false); // default: false
// MY_SCAN_REQUEST_CODE is arbitrary and is only used within this activity.
startActivityForResult(scanIntent, MY_SCAN_REQUEST_CODE);
I Am using io.card:android-sdk:5.4.0.
@SankarAndroid, there is most likely a bug with expiry on Android. Several folks have not been able to successfully get it to work for several releases.
Thanks for the reply @braebot . May I know when can we expect the next release of card.io so that we can successfully get the expiry date along with card number.
Can confirm the issue. Used latest version. Devices tested - Samsung S6, Nexus 6, Xiaomi Redmi 3. Even with EXTRA_SCAN_EXPIRY = true can`t get the expiration date. The card itself is black and digits are silver and recognised without any problems on iPhones. Please, investigate this issue.
I also can't read the expiry date. Just can scan card number. I used the 5.4.2 version SDK. I tested it in Galaxy S6, GalaxyNote2, Nexus 5, LG G5.
@braebot, On nexus 5x I also can't scan expiry. But on same device Uber and Beam can scan. Can you please let me know if I am missing something.
Intent scanIntent = new Intent(this, CardIOActivity.class);
scanIntent.putExtra(CardIOActivity.EXTRA_SUPPRESS_MANUAL_ENTRY, true);
scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, true);
scanIntent.putExtra(CardIOActivity.EXTRA_SCAN_EXPIRY, true);
scanIntent.putExtra(CardIOActivity.EXTRA_HIDE_CARDIO_LOGO, true);
scanIntent.putExtra(CardIOActivity.EXTRA_USE_PAYPAL_ACTIONBAR_ICON, false);
scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_CVV, false);
scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_POSTAL_CODE, false);
scanIntent.putExtra(CardIOActivity.EXTRA_RESTRICT_POSTAL_CODE_TO_NUMERIC_ONLY, false);
startActivityForResult(scanIntent, MY_SCAN_REQUEST_CODE);
Hi @braebot, is there any update about this issue?.
Hi @lkorth, is there any update on this?
Guys, any update on this issue?
buildTypes { debug { minifyEnabled false debuggable true } }
also in manifest file : android:debuggable="true" in application tag. works
does this expiry date issue fix?
Any update on this?
👍
Our best approach to get the expiry date was this one:
- Exclude 64bit ABIs (x86_64, arm64-v8a). That's why it works on some devices better/worser
- Take Version 5.4.0
It works about 60-70%, depends on device and/or card
@MarcelRitz solution worked for us, started to see expiry date recognized. It is not guaranteed though, might have to try a few times, turning on flash can help.
confirm issue on Nexus Android 7.1.1 using Cardio:5.5.1 Sample Application. Expiry Month and Years : 0/0 .
any update for this issue? Uber app recognize the expiry date sometimes but the current sample app doesn't. My device is Galaxy S8 (Android 7.0)
No working for my either, running an Android 6.0.1 (OP2).
Also seeing this issue with version 5.5.1, it's 100% reproducible on all the devices we have here including One Plus 3T, Pixel 2, Samsung Galaxy S7
Same issue with version 5.5.1 and Samsung Note 5. The expiry date is not recognized.