I'm trying to use TouchID within my Ionic 2 app. I have an iphone 5c, so I can't test it on real device.
I imported the package :
import { TouchID } from 'ionic-native';
Then, I tested the first function (I already activated touchID in the hardware section of the emulator):
TouchID.isAvailable()
.then(
res => console.log('TouchID is available!'),
err => console.error('TouchID is not available', err)
);
Everything works fine. Now what I would like to do, is testing this function :
TouchID.verifyFingerprint('Scan your fingerprint please')
.then(
res => console.log('Ok', res),
err => console.error('Error', err)
);
It's possible to test it on emulator ? The emulator can listen to fingerprint action ?
Run your Android emulator and go to Settings->Security & location->Fingerprint. If you have set up your PIN, enter it on your emulator. If you haven't set up your PIN, Android emulator will prompt you to add it at this point. Click Add fingerprint.
You can show touch indicators in the iOS simulator by opening Terminal and running defaults write com. apple. iphonesimulator ShowSingleTouches 1 . You can turn this setting off again by running defaults write com.
Anyone who is using latest Xcode (version 12x), there is no Hardware
menu, it's been replace by 'Feature`. So to enroll the touch id,
Features -> Touch Id -> Enrolled
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With