Speech Recognition Plugin

Hi! I am currently having an issue with this plugin. Error keeps prompting like this.

Hi Richard,

If you are using any pulgin than not able to test on browser.

In this cas you need to check first cordova is define or not . 

Regards

Rahul Sahu

Hi Rahul!

Thanks for the fast reply. I'll check this one.


Regards,
Richard

Hi, again Rahul!

Is there any other way to check if the Cordova is Defined?


Regards,
Richard

Hi Richard,

Yes you can do it by js code but cordova is alreday provide OS.

YOu need to use only common pulgin and here is "IsCordovaDefined" component

just drag and drop and use it  is return True Or False based on cordova define.


Regards

Rahul Sahu

Solution

Hello Richard,

You need to check if that plugin is available or not before you invoke any other method from it. In order to do that, you should use the isRecognitionAvailable function inside the plugin:


If you check the code inside of it, not only it validates if the Cordova is defined, but also validates if the plugin is avaible. It is useful to verify if the current application has the plugin installed.


Using this action before calling any other from the plugin will allow you to control what the application needs to do when it doesn't have the plugin available.

Please, be aware that plugins can only be tested in real mobile devices. This means that you won't be able to test them in the browser (like Rahul said), so the return of this action will always be false in the browser.

If you test it in a real mobile device, make sure that you generate new builds for your application with that plugin on it, before installing the APK / IPA files in your mobile devices.


Kind regards,

Rui Barradas

Solution

Thanks, everyone!

I managed to troubleshoot my issue. Need to generate the application natively first for it to run perfectly. 


Hello Richard,


Glad that you managed to solve your issue.

Thanks for letting us know.


Kind regards,

Rui Barradas