Search code examples
iosswiftios11url-schemetouch-id

Cannot Launch Touch ID & Passcode with URL Schema in iOS 11 using swift


I'm using below code to navigate to the Touch ID and Passcode section using swift,

guard let profileUrl = URL(string : "App-Prefs:root=TOUCHID_PASSCODE") else {
            return
}

if UIApplication.shared.canOpenURL(profileUrl){
     if #available(iOS 10.0, *) {
                UIApplication.shared.open(profileUrl, options: [:], completionHandler: nil)
            } else {
                // Fallback on earlier versions
         }
 }

It worked properly with iOS 10. but this doesn't work now. it navigates only to the Settings, not to the Touch ID & Passcode section. any reason for this.


Solution

  • Apple has removed that functionality from the Settings app. Your only choice to keep these functional would be to remain on iOS 10.

    From iOS 11 you can Only call Main Setting Screen,

    guard let profileUrl = URL(string : "App-Prefs:") else {
            return
    }