Open Keyboard's settings screen in iOS's settings app programmatically from another app

前端 未结 3 1730
北荒
北荒 2020-12-29 12:45

How can we go directly to any of the below mentioned screens of iOS\'s settings app programmatically

3条回答
  •  -上瘾入骨i
    2020-12-29 13:30

    As of iOS 10 "App-Prefs:root" should be used rather than "prefs:root". See below Objective C code. Tested this , code works fine but Apple may reject the app because of this.
    Note : As pointed out this will work only on ios 10

     NSString *settingsUrl= @"App-Prefs:root=General&path=Keyboard";
    
     if ([[UIApplication sharedApplication] respondsToSelector:@selector(openURL:options:completionHandler:)]) {
    
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:settingsUrl] options:@{} completionHandler:^(BOOL success) {
        NSLog(@"URL opened");
        }];
    }
    

提交回复
热议问题