1

My app uses Touch ID, but if the user has not enabled it I am currently asking them to manually open the Settings app and scroll down to the Touch ID item.

Is there a way to directly link them to the Touch ID Settings page shown below from within my app?

(Note that I don't want open the Settings app at the top level, or open the app's native settings page as described in is it possible to open Settings App using openURL?.)

A Cordova plugin would be ideal, but documentation on any iOS system call would be great.

enter image description here

Community
  • 1
  • 1
Mike Chamberlain
  • 39,692
  • 27
  • 110
  • 158
  • No, there are no longer any methods for directly opening specific settings screens. Your app should also operate in the absence of TouchID as not all devices have it or the user may not want to set it up. – Paulw11 May 04 '16 at 03:41
  • This is not a duplicate because am I asking to open the app to a specific screen within the Settings app, rather than at the top level. Some screens *do* expose such as API, for instance the native settings for a specific app: https://github.com/selahssea/Cordova-open-native-settings/blob/master/src/ios/NativeSettings.m. My app operates fine without Touch ID, but I want to improve the UX by making it as easy as possible for the user enable it should they wish to. – Mike Chamberlain May 04 '16 at 04:48
  • Please unmark as a duplicate. If the answer is "no this is not possible" then feel free to add this and I'll mark it as the accepted answer. – Mike Chamberlain May 04 '16 at 04:50
  • As of ios8 you can open *your own apps* settings, as described in the duplicate, and some system dialogs will open specific settings pages directly, but there is no way for an app to directly open a specific settings page – Paulw11 May 04 '16 at 04:50
  • The Cordova code you linked to is the same code that is in the duplicate wrapped in a Cordova module – Paulw11 May 04 '16 at 04:53
  • But that's not the question I am asking, which is think is pretty clear from the title of the question and the screenshot I provided. – Mike Chamberlain May 04 '16 at 04:55
  • The duplicate answers broader question "Can I open page xxx of settings" from my app. The answer is no. – Paulw11 May 04 '16 at 04:56
  • Are you sure you've linked to the right question? That one mentions nothing about opening a specific page as far as I can see, nor does it make it clear that in the general case it is impossible. Please correct me if I've missed it. – Mike Chamberlain May 04 '16 at 05:01

3 Answers3

3

Apple changes the way to open specific menu in Settings. The value of scheme for iOS 10 is "App-Prefs:". But maybe it will be changed in next versions.

You can try to open different URLs in a cycle. Remember that the constant UIApplicationOpenSettingsURLString is not defined in iOS 7 (if you support this version).

Please take a look on my code. It works on iOS 10 and lower versions.

// UIApplicationOpenSettingsURLString is available since iOS 8.0
NSString * defaultSettingsStr = ( &UIApplicationOpenSettingsURLString != NULL ? UIApplicationOpenSettingsURLString : @"prefs:root" );

// Array of possible URLs, differ in various iOS versions
NSArray * urlStrs = @[@"App-Prefs:root=TOUCHID_PASSCODE",
                 @"Prefs:root=TOUCHID_PASSCODE",
                 defaultSettingsStr];

for (NSString * urlStr in urlStrs) {
   NSURL * url = [NSURL URLWithString:urlStr];

   if ([[UIApplication sharedApplication] canOpenURL:url]) {
       // openURL is deprecated since iOS 10
       [[UIApplication sharedApplication] openURL:url];
       break;
   }
}
KepPM
  • 1,129
  • 7
  • 17
0

Sadly, it is not possible to open the Touch ID page.

EDIT: This was changed again under iOS 10, please check the answers below.

Eli Braginskiy
  • 2,867
  • 5
  • 31
  • 46
0

This works for me:

 NSURL* url = [NSURL URLWithString:@"prefs:root=TOUCHID_PASSCODE"];
 [[UIApplication sharedApplication] openURL:url];

edit: I think this only worked because I have an app (Launcher) installed that has registered the prefs URL scheme. The above only worked on a device that did not have this app installed after I registered this scheme in my own app by configuring CFBundleURLTypes in my plist by doing the following:

target -> Info -> URL Types -> (add) -> URL Schemes = "prefs"

masty
  • 1,539
  • 1
  • 17
  • 20