EddyVerbruggen / cordova-plugin-touch-id

:nail_care: 👱‍♂️ Forget passwords, use a fingerprint scanner!
MIT License
214 stars 72 forks source link

Face/Touch ID prompt not displaying on iOS Simulator #69

Open TomSeldon opened 5 years ago

TomSeldon commented 5 years ago

I'm having an issue, where on the iOS simulator when I call window.plugins.touchid.verifyFingerprint it is calling the success callback but not actually showing the Face/Touch ID prompt.

I may have misunderstood how this is meant to work on a simulator, but my understanding was that I should:

Instead, assuming I have already ticked "Enrolled", it doesn't show the prompt, and calls the success callback.

I thought this may be an issue with my app, so I started a new Cordova project, installed this plugin, and tried again there, but I get the same issue.

Example code:

# Terminal
npm i -g ionic cordova
ionic start "Test app" blank --type=angular --cordova

cd test-app

ionic cordova plugin add cordova-plugin-touch-id --variable FACEID_USAGE_DESCRIPTION="For easy authentication"

# run app in iOS simulator
// Run from Safari console attached to iOS emulator

window.plugins.touchid.isAvailable(console.log, console.error);
// logs `'face'`

window.plugins.touchid.didFingerprintDatabaseChange(console.log, console.error);
// logs `false`

window.plugins.touchid.verifyFingerprint('Some message...', console.log, console.error);
// logs `null`

///////

function onSuccess() { console.log('success') }

window.plugins.touchid.verifyFingerprint('Some message...', onSuccess, console.error);
// logs `'success'`
yornel13 commented 5 years ago

Do you solved? I have same issue

cvinodhkumar77 commented 4 years ago

TouchID and FaceID will not work in simulators. Please try in real device