Hello all.
I’ve installed the ionic native speech recognition plugin, I’ve installed it multiple times in different projects, updated all the packages, as far as I’m aware. I can get all of the other plugins working as expected apart from this one.
I’ve installed both the Cordova and the Ionic Native plugin like:
$ ionic cordova plugin add cordova-plugin-speechrecognition
$ npm install --save @ionic-native/speech-recognition
My app.module.ts file is as follows, where I have placed the speech recognition plugin in the page SpeechPage:
import { NgModule, ErrorHandler } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';
import { AboutPage } from '../pages/about/about';
import { ContactPage } from '../pages/contact/contact';
import { HomePage } from '../pages/home/home';
import { TabsPage } from '../pages/tabs/tabs';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { SpeechRecognition } from '@ionic-native/speech-recognition';
import { SpeechPage } from '../pages/speech/speech';
import { BarcodeScanner } from '@ionic-native/barcode-scanner';
import { ScannerPage } from '../pages/scanner/scanner';
@NgModule({
declarations: [
MyApp,
AboutPage,
ContactPage,
HomePage,
TabsPage,
SpeechPage,
ScannerPage
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
AboutPage,
ContactPage,
HomePage,
TabsPage,
SpeechPage,
ScannerPage
],
providers: [
StatusBar,
SplashScreen,
SpeechRecognition,
BarcodeScanner,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
})
export class AppModule {}
I’ve created this, to ensure my plugin is ready before attempting to make a call to it, in my speech.ts:
import { SpeechRecognition } from '@ionic-native/speech-recognition';
...
ngOnInit(){
this.platform.ready().then(
()=>{
this.s.hasPermission().then((has: boolean)=>{
if(has){
console.log('great');
}
});
}
)
}
...
But every time I try to run this…in my ios device and or in the IonicDevApp (android and ios device) I receive
Uncaught (in promise): plugin_not_installed
This additional information might be useful. Many thanks for any help:
Ionic Framework: 3.9.2
Ionic App Scripts: 3.2.0
Angular Core: 5.2.11
Angular Compiler CLI: 5.2.11
Node: 8.1.4
OS Platform: macOS High Sierra
Navigator Platform: MacIntel
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6