# react-native-speech-to-text-ios

> React Native speech recognition component for iOS 10+

Latest version **1.0.4** (published 2017-06-01) · 0 weekly downloads

## Install

```sh
npm install react-native-speech-to-text-ios
pnpm add react-native-speech-to-text-ios
yarn add react-native-speech-to-text-ios
bun add react-native-speech-to-text-ios
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2017-06-01 |
| First published | 2016-11-21 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 39 |
| Author | Volodymyr Musiienko |
| Maintainers | muhaos |
| Keywords | react-native, speech, recognition |

## Links

- npm: https://www.npmjs.com/package/react-native-speech-to-text-ios
- Repository: https://github.com/muhaos/react-native-speech-to-text-ios
- Homepage: https://github.com/muhaos/react-native-speech-to-text-ios#readme
- Issues: https://github.com/muhaos/react-native-speech-to-text-ios/issues
- npm.io page: https://npm.io/package/react-native-speech-to-text-ios

## Recent versions

- 1.0.4 (latest) — 2017-06-01
- 1.0.3 — 2017-02-28
- 1.0.2 — 2017-02-28
- 1.0.1 — 2017-02-28
- 1.0.0 — 2016-11-21

## README

![alt tag](https://github.com/muhaos/react-native-speech-to-text-ios/blob/master/baner.png)

# react-native-speech-to-text-ios [![npm version](https://img.shields.io/npm/v/react-native-maps.svg?style=flat)](https://www.npmjs.com/package/react-native-speech-to-text-ios)

React Native speech recognition component for iOS 10+

## Getting started

`$ npm install react-native-speech-to-text-ios --save`

`$ react-native link react-native-speech-to-text-ios`

## IMPORTANT xCode plist settings

Also, you need open the React Native xCode project and add two new keys into `Info.plist`
Just right click on `Info.plist` -> `Open As` -> `Source Code` and paste these strings somewhere into root `<dict>` tag

```xml
<key>NSSpeechRecognitionUsageDescription</key>
<string>Your usage description here</string>
<key>NSMicrophoneUsageDescription</key>
<string>Your usage description here</string>
```

Application will crash if you don't do this.

## Usage

```js

import {
  ...
  NativeAppEventEmitter,
  ...
} from 'react-native';

var SpeechToText = require('react-native-speech-to-text-ios');

...

this.subscription = NativeAppEventEmitter.addListener(
  'SpeechToText',
  (result) => {

    if (result.error) {
      alert(JSON.stringify(result.error));
    } else {
      console.log(result.bestTranscription.formattedString);
    }
	
  }
);

SpeechToText.startRecognition("en-US");

...

componentWillUnmount() {
  if (this.subscription != null) {
    this.subscription.remove();
    this.subscription = null;
  }
}

```

To stop recording call `SpeechToText.finishRecognition()` but after that you can continue to receive event with final recognition results. The events will not arrive after `result.isFinal == true`.
Call `SpeechToText.stopRecognition()` to cancel current recognition task.
The `result` objects reflects Apple `SFSpeechRecognitionResult` class.

Use this link to reference error codes https://developer.nuance.com/public/Help/DragonMobileSDKReference_iOS/Error-codes.html

---
_Source: https://npm.io/package/react-native-speech-to-text-ios · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
