3

I try to detect the biometric capabilities of an iPhone like this:

let authenticationContext = LAContext()

switch authenticationContext.biometryType 
{ case LABiometryType.typeFaceID:
  print("faceID")
  case LABiometryType.typeTouchID:
  print("touchID")
  case LABiometryType.none:
  print("no biometric")
}

In Xcode 9 I get in the iPhone-X and iPhone 8 Simulator "LABiometryType.none" instead of expected LABiometryType.typeFaceID and LABiometryType.typeTouchID

Is that the correct way to detect Face-ID?

(It´s not about detecting an iPhone X (future iPhones will probably also support Face-ID)

mica
  • 3,898
  • 4
  • 34
  • 62
  • Look into the hardware Menu of the Simulator. There you can simulate successful and not successful touchID and faceID authentication. TouchID testing works fine for me, – mica Oct 08 '17 at 17:17
  • 2
    I don´t think the question is a duplicate. support of face-ID has not much to do with detecting an iPhone-X, assuming that many apple devices in the future will support face-ID. – mica Oct 09 '17 at 08:40
  • My question is: Is the way described in the post correct, even if it doesn't´t work in the simulator (maybe a Bug?) – mica Oct 09 '17 at 08:41
  • 1
    It's a bug. You need to use Xcode 9.1 (which is currently in beta) for this to work. – Tom Hall Oct 12 '17 at 01:44
  • 4
    This question is not a duplicate at all – Joris Mans Oct 27 '17 at 08:34

0 Answers0