3

Based on this link, https://stackoverflow.com/a/28152624/743663 you can open ACCESSIBILITY settings, but can I dig into more with URL settings like ACCESSIBILITY->Speech-Voice?

My app uses text to speech, so I want users to go to the voice settings to download enhanced voices easily.

I guess there is no way to download enhanced voices programmatically, so I want to show the settings screen easily at least.

This is the way to open ACCESSIBILITY.

override func viewDidAppear(_ animated: Bool) {
    let alertController = UIAlertController (title: "Title", message: "Go to Settings?", preferredStyle: .alert)

    let settingsAction = UIAlertAction(title: "Settings", style: .default) { (_) -> Void in
        guard let settingsUrl = URL(string: UIApplicationOpenSettingsURLString) else {
            return
        }

        if UIApplication.shared.canOpenURL(settingsUrl) {
            UIApplication.shared.open(settingsUrl, completionHandler: { (success) in
                print("Settings opened: \(success)") // Prints true
            })
        }
    }
    alertController.addAction(settingsAction)
    let cancelAction = UIAlertAction(title: "Cancel", style: .default, handler: nil)
    alertController.addAction(cancelAction)

    present(alertController, animated: true, completion: nil)
}

I tried "App-Prefs:root=General&path=ACCESSIBILITY&@path=SPEECH", but it didn't work.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Umeumeume
  • 1,952
  • 3
  • 21
  • 40

1 Answers1

2

swift 5: ios 13

try this:- App-prefs:root=General&path=ACCESSIBILITY/VOICEOVER/Speech

work for me

  • Is it legal on iOS13? It used to be illegal to use this address before. – Umeumeume Jan 01 '20 at 03:57
  • yes my friend this comes to private api so, use under testing purpose. cau'z apple use a default way of there own to open settings. if (@available(iOS 10.0, *)) { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:[NSDictionary dictionary] completionHandler:nil]; } else { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]]; } – Chhagan Meena Jan 02 '20 at 05:03