Added an optional onError callback to the options object. It is called on errors in Android and provides the error code from the SpeechRecognizer of Android. A link to the error codes is provided in the doc comment.
I don't know if there's a place it should also be called on iOS, as I'm only using this on Android.
I have tested that it works and I use it to restart listening when nothing is recognized or recognition times out (error codes 6 ERROR_SPEECH_TIMEOUT and 7 ERROR_NO_MATCH).
Added an optional onError callback to the options object. It is called on errors in Android and provides the error code from the SpeechRecognizer of Android. A link to the error codes is provided in the doc comment. I don't know if there's a place it should also be called on iOS, as I'm only using this on Android.
I have tested that it works and I use it to restart listening when nothing is recognized or recognition times out (error codes 6 ERROR_SPEECH_TIMEOUT and 7 ERROR_NO_MATCH).