Search code examples
iosswiftiphone-xface-id

How to check Face id is enabled for my application?


I have implemented face id API in my application. Currently Face id is registered for device but disabled for my app.

How do I check programmatically in Swift that Face id is enabled for my app?

I know to check the face id is registered in device or not.


Solution

  • let context = LAContext()
    if ( context.biometryType == .typeFaceID ) {
          // Face ID
    }
    if ( context.biometryType == .typeTouchID) {
         // Touch ID
    } else {
        // Stone Age
    }
    

    don't forgot to put versioning condition cuz faceID is only available after ios 11