Skip to content

Conversation

@neooriginal
Copy link
Collaborator

This pull request adds support for requesting speech recognition permissions on iOS and improves language handling for on-device transcription settings. The main changes include implementing a permission request method for Apple's speech recognition, updating the iOS handler to respond to permission requests, and refining language selection logic to ensure compatibility.

iOS Speech Recognition Permission Handling:

  • Added a requestPermission method to SpeechRecognitionHandler in AppDelegate.swift that requests authorization from SFSpeechRecognizer and returns the result to Flutter.
  • Implemented a static requestPermission method in OnDeviceAppleProvider that invokes the corresponding platform channel method and logs errors if permission requests fail.

Transcription Settings Improvements:

  • Modified the language getter in _TranscriptionSettingsPageState to default to 'en' instead of 'multi' when running on iOS, ensuring a valid language code is used.
  • When selecting the on-device provider on iOS, now calls OnDeviceAppleProvider.requestPermission() to ensure permissions are requested as needed.

Dependency Updates:

  • Imported on_device_apple_provider.dart in transcription_settings_page.dart to enable permission handling integration.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces permission handling for on-device speech-to-text on iOS. The changes are generally good, but there's a significant issue in how the permission result is handled. The native code correctly returns whether permission was granted, but the Dart code ignores this result. This leads to a poor user experience where transcription might fail silently if the user denies permission. The suggestions provided aim to properly handle the permission result and inform the user if permission is denied, both by modifying the requestPermission method to return a boolean and by checking this boolean in the calling code.

@neooriginal neooriginal requested a review from beastoin January 2, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant