Files
archived-orca/mobile/src/platform/native-accessibility-announce.ts
Kelvin Amoaba a5dbd1cb2f feat(mobile): read dictation progress to VoiceOver and TalkBack (#40504)
* feat(mobile): announce dictation to VoiceOver through the shell

* feat(mobile): speak dictation from the host, so leaving the session and the pill's toasts are announced too

* fix(mobile): say dictation outcomes where they are known, and re-read a repeated live message

* fix(mobile): leave a setup refusal to its setup sheet instead of reading the raw code

* fix(mobile): say cancelled when a kept recording is discarded
2026-11-09 22:52:59 +00:00

13 lines
633 B
TypeScript

import { AccessibilityInfo, Platform } from 'react-native'
import { a11yAnnounceParamsSchema } from '../mobile-web-shell/bridge/bridge-native-verbs'
// VoiceOver ignores the page's live regions inside the shell's WebView, so the shell announces for it; TalkBack reads them, so Android leaves it to the page.
export function serveNativeAnnounceVerb(params: unknown): { announced: boolean } {
const { message } = a11yAnnounceParamsSchema.parse(params)
if (Platform.OS !== 'ios') {
return { announced: false }
}
AccessibilityInfo.announceForAccessibilityWithOptions(message, { queue: true })
return { announced: true }
}