How to disable dictation on iOS 16 system keyboard

In our app, prior to iOS 16, we disable dictation by listening for an input mode change notification where the primaryLanguage == "dictation" and then showing an alert that dictation is disabled. We have to disable it at the app level for HIPAA compliance.

On iOS 16 however this notification is not sent (seemingly because it it no longer an input mode change). Is there any way to do this now? I know we can add a custom input view but that seems like overkill just to remove a single button.

  • Good evening, did you find any solution to this scenario?. In our app we were doing exactly the same, and now, since iOS 16 there is no event available to observe the dictation key is pressed, and the keyboard mode it's not changing and firing the event anymore. In fact there is no event to observe even when starting the dictation from the keyboard. Thx in advance.

Add a Comment

Replies

Also, support for third-party keyboards seems to have ended. Real Gboard is the only thing I miss from Android every day. Gboard for iOS is rarely updated and works poorly. Third-party keyboards don't seem as responsive as built-in keyboards. I have autocorrect turned off. Because, without being able to teach me, it garbles every time I try to type the most irrelevant and bizarre autocorrect.

Regards, J Wick

Good evening, did you find any solution to this scenario?. In our app we were doing exactly the same, and now, since iOS 16 there is no event available to observe the dictation key is pressed, and the keyboard mode it's not changing and firing the event anymore. In fact there is no event to observe even when starting the dictation from the keyboard. Thx in advance.

We are experiencing the same things. Our software need to be HIPAA compliant and not allow dictation for our hospital systems. We have used this notification (textInputCurrentInputModeDidChange) and checking the primary language to prompt the user that dictation violates the hospitals policies. Now, the same code that has worked since 2014, on iOS16, it is allowing users on to bypass this security/compliance issue.

It is strange that some of our search fields, the notifications fire, just not in the normal text input fields.

I know that with iO16 they have some “continuous dicatiation” keeping typing and dictation active at the same time for mixed, entry. That’s probably why it no longer considers it a “change in textInputMode”)

Looking for a solution. It should not be hard for apple to provide us with a notification if the button is pressed anyway.

Any updates from Apple? Or anyone? We violate HIPAA compliance by several dozen hospitals where our application is used and getting badged weekly by their compliance officers. We had no issues before iOS 16, as we could check for the keyboard using dictation and prompt the user.

Apple cares about privacy - maybe they could help us out and give us an API to mitigate other company's stances on privacy.

Does anyone have a workaround for this? Apple is not responding to Feedback (bug/enhancement) filed. The solution that was suggested was to switch to a .email keyboard.

While this does remove the dictation button, it is terrible for entering text as particular punctuation (like a comma or > symbol) is not there. Medical professionals use our app for secure clinician communication, and they need to be able to type a message explaining a medical condition quickly - not fumble with the keyboard layout.

We are asking for 1 of the 3 options

  • Provide a programmatic way to disable dication per app.
  • Provide a programmatic way to set a UITextField to have .allowDication. Eg. textField.keyboardType = .default; textField.allowDictation = false
  • Restore notification when dictationButton is pressed (via textInputCurrentInputModeDidChange) - this is what our company has used for the past 10 years

A weird thing is the notification still fires on an iPhone X with iOS 16.2. We have a react-native application where we need to capitalize and/or apply a mask to input, but it causes dictation to end prematurely, so I was using the notification to suspend modifying the input until dictation is finished. It worked on my development phone, but then failed when QA tested on an XR.

The old way of determining if dictation was taking place:

UITextInputMode.primaryLanguage == @"dictation"

if no longer working for iOS 16.4 is this a bug and will it be restored in the future, or will another way to determine if dictation is about to take place be provided?

Thanks, Rob