I've integrated LocalAuthentication for my app security purpose, which has been supporting 'Touch Id' based supporting. But now, apple has recently added 'Face Id' based authentication also.
How can I check, which type of authentication is supported by a device. Touch Id or Face Id?
I made a singleton class for local authentication as it helps to initialise an instance one time using
static
property for the entire application.Implementation:
From @Markicevic extension, but ignoring cases where user is not enrolled, etc...
}
Objective C :)
Face ID is available from iOS 11 and iPhone X comes with iOS 11 by default. In the LocalAuth framework they have added a 'biometryType' property which can give you ability to detect whether Face ID is available on device.