Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using TouchID on emulator

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 ?

like image 934
Mourad Idrissi Avatar asked Jan 19 '17 12:01

Mourad Idrissi


People also ask

How do I enable Touch ID on my emulator?

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.

How do you show touches on Iphone simulator?

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.


1 Answers

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,

  1. Open simulator
  2. Go to Features -> Touch Id -> Enrolled

enter image description here

like image 55
Jimba Tamang Avatar answered Sep 30 '22 16:09

Jimba Tamang