From eef1cd000ef11e42586681a41f60f9aac9ffdadd Mon Sep 17 00:00:00 2001 From: jamsch <12927717+jamsch@users.noreply.github.com> Date: Wed, 20 Nov 2024 12:54:20 +1300 Subject: [PATCH] chore: update docs for getSpeechRecognizerPermissionsAsync --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index a8590b1..8a875c7 100644 --- a/README.md +++ b/README.md @@ -943,6 +943,21 @@ ExpoSpeechRecognitionModule.getMicrophonePermissionsAsync().then((result) => { > [!NOTE] > This is only supported on iOS. +Checks the current permissions to use network-based recognition for [`SFSpeechRecognizer`](https://developer.apple.com/documentation/speech/sfspeechrecognizer) for iOS. + +```ts +import { ExpoSpeechRecognitionModule } from "expo-speech-recognition"; + +ExpoSpeechRecognitionModule.getSpeechRecognizerPermissionsAsync().then( + (result) => { + console.log("Status:", result.status); // "granted" | "denied" | "not-determined" + console.log("Granted:", result.granted); // true | false + console.log("Can ask again:", result.canAskAgain); // true | false + console.log("Expires:", result.expires); // "never" | number + }, +); +``` + ### `getStateAsync(): Promise` Returns the current internal state of the speech recognizer.