How to open the keyboard settings screen programmatically in iOS 10?

How to open the keyboard settings screen programmatically in iOS 10?

This code does not work in iOS 10

NSURL *keyboardSettingsURL = [NSURL URLWithString: @"prefs:root=General&path=Keyboard/KEYBOARDS"]; [[UIApplication sharedApplication] openURL:keyboardSettingsURL]; 

and added URL scheme

+6
source share
5 answers

It seems that this feature was disabled in iOS 10. I believe that https://developer.apple.com/library/content/qa/qa1924/_index.html is no longer valid. I checked several applications with the upper keyboard, and they were either updated to no longer have a direct link to the settings, or to have an inoperative button.

+5
source

works in iOS 10+

 NSURL *keboardURL = [NSURL URLWithString: @"App-Prefs:root=General&path=Keyboard/KEYBOARDS"]; [[UIApplication sharedApplication] openURL:keyboardURL]; 

key points:

@ "App-Prefs: root = General & path = Keyboard / KEYBOARD"

+2
source

You may need to add a URL scheme to your project if you have not already done so. Instructions and more information can be found on this Apple Q & A Reference . Hope this helps!

0
source

IOS 10 requires a new URL. Try using this code that checks both URLs:

 NSArray* urlStrings = @[@"prefs:root=General&path=Keyboard/KEYBOARDS", @"App-Prefs:root=General&path=Keyboard/KEYBOARDS"]; for(NSString* urlString in urlStrings){ NSURL* url = [NSURL URLWithString:urlString]; if([[UIApplication sharedApplication] canOpenURL:url]){ [[UIApplication sharedApplication] openURL:url]; break; } } 
0
source
 For IOS-10 or higher,openURL is deprecated. use with completion handler like below. NSString *settingsUrl= @"App-Prefs:root=General&path=Keyboard"; if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0){ if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:settingsUrl]]) { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:settingsUrl] options:@{} completionHandler:nil]; } } 
0
source

All Articles