hieuvp / react-native-fingerprint-scanner

Provide Fingerprint, Touch ID, and Face ID Scanner for React Native (Compatible with both Android and iOS)
https://www.npmjs.com/package/react-native-fingerprint-scanner
871 stars 297 forks source link

Upgrade android to use new BiometricPrompt API #115

Closed fkotsian closed 4 years ago

fkotsian commented 4 years ago

Provides native prompt to authenticate; brings Android to parity with iOS

These are breaking changes, but perhaps are necessary as the underlying package for Android is fundamentally different No longer any breaking changes

fkotsian commented 4 years ago

Sorry about the WIP, but left commits separate as easier to review.

One note -- this does remove support for the Samsung and MeiZu Fingerprint SDKs, as the underlying library is changed out for the official Android lib.

If this is an issue, I can add it back in, probably switching on API version < 23 (the point at which native Android fingerprint is no longer supported). However, this would expose two different APIs in the lib - one with the native prompt for Android >= 23, and one with the lower-level auth method for Android < 23 on a Samsung or MeiZu (if I understand https://github.com/uccmawei/FingerprintIdentify correctly)

phillbaker commented 4 years ago

I think React Native support is >= Android 4.1 (API 16) and >= iOS 9.0 (probably good to verify that those versions are up to date), so to cover the middle we'd probably need to keep both sets of dependencies. If your user base has a lot of androids and they're cheap/old then a decent chance that those older versions will pop up.

It looks like this would close https://github.com/hieuvp/react-native-fingerprint-scanner/issues/110.

fkotsian commented 4 years ago

@phillbaker OK, updated with legacy compat. Unfortunately don't have a <v23 Samsung or MeiZu phone to test this, but tests pass and can confirm this works on Android > 23 and == 29

If you give the thumbs up I will merge and if there are any issues I recommend staying on 3.0.2 and will create a fix

TY 😄

fkotsian commented 4 years ago

TY @chris-griffin !