rushisangani / BiometricAuthentication

Use Apple FaceID or TouchID authentication in your app using BiometricAuthentication.
MIT License
831 stars 110 forks source link

Show correct message when biometry is not enrolled #35

Closed Sidetalker closed 4 years ago

Sidetalker commented 4 years ago

.faceIDAvailable() always returns false if biometry is not enrolled which results in the TouchID message being shown regardless of device. This PR patches that bug without changing the existing functionality of .faceIDAvailable() so as not to introduce a potentially breaking change.

Reproduction Steps:

Observe: An alert prompts the user to enroll their fingerprints for Touch ID Expected: An alert prompts the user to enroll their face for Face ID

rushisangani commented 4 years ago

@Sidetalker thank you so much for finding this and creating a PR. However, I didn't like the approach to add authentication code in AuthenticationError file.

I thought about this and come up with a solution to identify if the device supports touchID or faceID. This would be useful in other cases as well (not only BiometryNotEnrolled).

I have released the new version 3.1.2 for the library which fixes this and also includes some other code refactoring.

rushisangani commented 4 years ago

@Sidetalker again, I really appreciate your efforts. Please keep contributing :)

Sidetalker commented 4 years ago

Thanks for the quick response @rushisangani! Your solution is a much better approach, I went with something quick and dirty to get the job done without impacting existing code and I'm glad you came up with a more robust fix. Many thanks for the speedy update.