I installed cordova background mode plugin by these commands
ionic cordova plugin add cordova-plugin-background-mode
npm install @ionic-native/background-mode
in app.module.ts i imported like this
import { BackgroundMode } from '@ionic-native/background-mode/ngx';
and added in providers array.
my page.component.ts
constructor(private pltfm: Platform, private backgroundMode: BackgroundMode) { }
ngOnInit() {
this.pltfm.ready().then(() => {
this.backgroundMode.on('activate').subscribe(() => {
console.log('activated');
});
this.backgroundMode.enable();
});
}
I got backgroundMode Plugin not installed error while running the app.How can i fix this problem?
Native: tried calling BackgroundMode.enable, but the BackgroundMode plugin is not installed.