muhaos / react-native-speech-to-text-ios

React Native speech recognition component for iOS 10+
MIT License
40 stars 9 forks source link

Error: undefined is not an object reactNativeSpeechToTextIos2 #1

Closed tonatiuh closed 7 years ago

tonatiuh commented 7 years ago

I've followed the install instructions (https://github.com/muhaos/react-native-speech-to-text-ios#important-xcode-plist-settings), however, I'm getting the following error:

undefined is not an object(evaluating '_reactNativeSpeechToTextIos2.default.startRecognition')

when running:

....
import SpeechToText from 'react-native-speech-to-text-ios';
...

export default class MyComponent extends Component {
  componentDidMount() {
    SpeechToText.startRecognition("en-US");
  }
}

Screenshot:

screen shot 2017-03-02 at 2 14 30 pm

Ios version: 10.21 (physical device and emulated)

tonatiuh commented 7 years ago

I'm closing this issue, I just found that was because I forgot to run "react-native link react-native-speech-to-text-ios". I thought that command was replaceable by the "IMPORTANT xCode plist settings."