Search code examples
iosswiftface-idlocalauthenticationios18

iOS 18 - how to know if the app requires Face ID?


I am preparing an app to work fine on iOS 18. There is an option in the app to turn on asking for biometrics to open it.

As you know, in iOS 18 Apple has added a feature to "Require Face ID" to unlock the app, which means, if users turns both in my app, it will ask for Face ID twice.

Is there any option to know whether user is already unlocking the app with Face ID, so I can hide the biometrics option for those kind of users?

img


Solution

  • No, there is currently no such API, as mentioned in this developer forums post by a DTS engineer at Apple.

    AFAIK this feature is entirely user level, with no APIs for app developers. If you’d like to see such APIs added in the future, I encourage you to file an enhancement request explaining your use case.

    What you can do for now, is to check if #available(iOS 18, *).

    • If the device is running on an older version, show the Face ID option as before
    • If the device is running on iOS 18+, hide the option, or perhaps show instructions on how to enable Face ID on their home screen, in place of the option.
    • If the device is running on iOS 18+, and your own Face ID is already turned on (this means the user has just updated their OS), show a message explaining this, and perhaps give them a button to turn off your own Face ID option.