| Summary: | [iOS] Web Speech API doesn't work in WKWebView, but webkitSpeechRecognition is still exposed | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ali Juma <ajuma> |
| Component: | WebKit API | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | Normal | CC: | achristensen, beidson, bfulgham, sihui_liu, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
|
Description
Ali Juma
2022-04-27 11:53:02 PDT
The current state in WKWebView is very confusing for web developers using feature detection, since webkitSpeechRecognition is exposed on window, but doesn't work (the permission prompt never appears). Here's a test page that works in Safari on iOS, but not on any other browser on iOS: https://www.google.com/intl/en/chrome/demos/speech.html Hi Ali, WebKit uses Speech framework for recognition, so your app might need to add NSSpeechRecognitionUsageDescription: https://developer.apple.com/documentation/speech/asking_permission_to_use_speech_recognition?language=objc. Did you already do that? or if you are a website developer... I think we will throw error when the app cannot prompt (e.g. due to missing the keyword), do you see the error? Or it's just nothing? The API should work in WebKit app. (In reply to Sihui Liu from comment #3) > Hi Ali, > > WebKit uses Speech framework for recognition, so your app might need to add > NSSpeechRecognitionUsageDescription: > https://developer.apple.com/documentation/speech/ > asking_permission_to_use_speech_recognition?language=objc. > > Did you already do that? Thanks! That explains why it isn't working. > or if you are a website developer... I think we will throw error when the > app cannot prompt (e.g. due to missing the keyword), do you see the error? > Or it's just nothing? Yes, we get a service-not-allowed error when trying to use the API. |